[asterisk-commits] mmichelson: branch mmichelson/threadpool r377802 - in /team/mmichelson/thread...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 10 22:23:35 CST 2012


Author: mmichelson
Date: Mon Dec 10 22:23:31 2012
New Revision: 377802

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=377802
Log:
Some documentation fixes and function call name fixes.

The documentation for taskprocessors was incorrect with
regards to when a listener's alloc callback was called.

I also made the names of queued function calls in the
threadpool more uniform.


Modified:
    team/mmichelson/threadpool/include/asterisk/taskprocessor.h
    team/mmichelson/threadpool/main/threadpool.c

Modified: team/mmichelson/threadpool/include/asterisk/taskprocessor.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/threadpool/include/asterisk/taskprocessor.h?view=diff&rev=377802&r1=377801&r2=377802
==============================================================================
--- team/mmichelson/threadpool/include/asterisk/taskprocessor.h (original)
+++ team/mmichelson/threadpool/include/asterisk/taskprocessor.h Mon Dec 10 22:23:31 2012
@@ -77,6 +77,7 @@
 	/*!
 	 * \brief Allocate the listener's private data
 	 *
+	 * This is called during taskprocesor creation.
 	 * It is not necessary to assign the private data to the listener.
 	 *
 	 * \param listener The listener to which the private data belongs
@@ -150,9 +151,7 @@
  * Allocate a taskprocessor listener
  *
  * This will result in the listener being allocated with the specified
- * callbacks. The listener's alloc() callback will be called to allocate
- * private data for the listener. The private data will be assigned to the
- * listener when the listener's alloc() function returns.
+ * callbacks.
  *
  * \param callbacks The callbacks to assign to the listener
  * \retval NULL Failure
@@ -177,6 +176,8 @@
 /*!
  * \brief Create a taskprocessor with a custom listener
  *
+ * The listener's alloc() and start() callbacks will be called during this function.
+ *
  * \param name The name of the taskprocessor to create
  * \param listener The listener for operations on this taskprocessor
  * \retval NULL Failure

Modified: team/mmichelson/threadpool/main/threadpool.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/threadpool/main/threadpool.c?view=diff&rev=377802&r1=377801&r2=377802
==============================================================================
--- team/mmichelson/threadpool/main/threadpool.c (original)
+++ team/mmichelson/threadpool/main/threadpool.c Mon Dec 10 22:23:31 2012
@@ -436,7 +436,7 @@
 }
 
 /*!
- * \brief Queue task called when tasks are pushed into the threadpool
+ * \brief Queued task called when tasks are pushed into the threadpool
  *
  * This function first calls into the threadpool's listener to let it know
  * that a task has been pushed. It then wakes up all idle threads and moves
@@ -444,7 +444,7 @@
  * \param data A task_pushed_data
  * \return 0
  */
-static int handle_task_pushed(void *data)
+static int queued_task_pushed(void *data)
 {
 	struct task_pushed_data *tpd = data;
 	struct ast_threadpool *pool = tpd->pool;
@@ -481,7 +481,7 @@
 		return;
 	}
 
-	ast_taskprocessor_push(pool->control_tps, handle_task_pushed, tpd);
+	ast_taskprocessor_push(pool->control_tps, queued_task_pushed, tpd);
 }
 
 /*!
@@ -491,7 +491,7 @@
  * \param data The pool that has become empty
  * \return 0
  */
-static int handle_emptied(void *data)
+static int queued_emptied(void *data)
 {
 	struct ast_threadpool *pool = data;
 
@@ -515,7 +515,7 @@
 		return;
 	}
 
-	ast_taskprocessor_push(pool->control_tps, handle_emptied, pool);
+	ast_taskprocessor_push(pool->control_tps, queued_emptied, pool);
 }
 
 /*!




More information about the asterisk-commits mailing list