mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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. git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -77,6 +77,7 @@ struct ast_taskprocessor_listener_callbacks {
|
|||||||
/*!
|
/*!
|
||||||
* \brief Allocate the listener's private data
|
* \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.
|
* It is not necessary to assign the private data to the listener.
|
||||||
*
|
*
|
||||||
* \param listener The listener to which the private data belongs
|
* \param listener The listener to which the private data belongs
|
||||||
@@ -150,9 +151,7 @@ struct ast_taskprocessor_listener {
|
|||||||
* Allocate a taskprocessor listener
|
* Allocate a taskprocessor listener
|
||||||
*
|
*
|
||||||
* This will result in the listener being allocated with the specified
|
* This will result in the listener being allocated with the specified
|
||||||
* callbacks. The listener's alloc() callback will be called to allocate
|
* callbacks.
|
||||||
* private data for the listener. The private data will be assigned to the
|
|
||||||
* listener when the listener's alloc() function returns.
|
|
||||||
*
|
*
|
||||||
* \param callbacks The callbacks to assign to the listener
|
* \param callbacks The callbacks to assign to the listener
|
||||||
* \retval NULL Failure
|
* \retval NULL Failure
|
||||||
@@ -177,6 +176,8 @@ struct ast_taskprocessor *ast_taskprocessor_get(const char *name, enum ast_tps_o
|
|||||||
/*!
|
/*!
|
||||||
* \brief Create a taskprocessor with a custom listener
|
* \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 name The name of the taskprocessor to create
|
||||||
* \param listener The listener for operations on this taskprocessor
|
* \param listener The listener for operations on this taskprocessor
|
||||||
* \retval NULL Failure
|
* \retval NULL Failure
|
||||||
|
@@ -436,7 +436,7 @@ static int activate_threads(void *obj, void *arg, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \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
|
* 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
|
* that a task has been pushed. It then wakes up all idle threads and moves
|
||||||
@@ -444,7 +444,7 @@ static int activate_threads(void *obj, void *arg, int flags)
|
|||||||
* \param data A task_pushed_data
|
* \param data A task_pushed_data
|
||||||
* \return 0
|
* \return 0
|
||||||
*/
|
*/
|
||||||
static int handle_task_pushed(void *data)
|
static int queued_task_pushed(void *data)
|
||||||
{
|
{
|
||||||
struct task_pushed_data *tpd = data;
|
struct task_pushed_data *tpd = data;
|
||||||
struct ast_threadpool *pool = tpd->pool;
|
struct ast_threadpool *pool = tpd->pool;
|
||||||
@@ -481,7 +481,7 @@ static void threadpool_tps_task_pushed(struct ast_taskprocessor_listener *listen
|
|||||||
return;
|
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 @@ static void threadpool_tps_task_pushed(struct ast_taskprocessor_listener *listen
|
|||||||
* \param data The pool that has become empty
|
* \param data The pool that has become empty
|
||||||
* \return 0
|
* \return 0
|
||||||
*/
|
*/
|
||||||
static int handle_emptied(void *data)
|
static int queued_emptied(void *data)
|
||||||
{
|
{
|
||||||
struct ast_threadpool *pool = data;
|
struct ast_threadpool *pool = data;
|
||||||
|
|
||||||
@@ -515,7 +515,7 @@ static void threadpool_tps_emptied(struct ast_taskprocessor_listener *listener)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_taskprocessor_push(pool->control_tps, handle_emptied, pool);
|
ast_taskprocessor_push(pool->control_tps, queued_emptied, pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Reference in New Issue
Block a user