Add a shutdown callback to taskprocessor listeners.

This helps account for the fact that it is unknown just
how many references may exist for a given taskprocessor
listener, so simply unreffing it from the taskprocessor
shutdown function is not enough to convey the gravity
of the situation.

By putting in a shutdown callback, it now becomes clear
to the listener not to try to do any further operations
on the taskprocessor.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2012-11-16 04:33:53 +00:00
parent e8898ec8ba
commit 12de4198b8
3 changed files with 34 additions and 4 deletions

View File

@@ -86,6 +86,18 @@ struct ast_taskprocessor_listener_callbacks {
* \param listener The listener
*/
void (*emptied)(struct ast_taskprocessor_listener *listener);
/*!
* \brief Indicates the taskprocessor wishes to die.
*
* All operations on the task processor must to be stopped in
* this callback.
*
* After this callback returns, it is NOT safe to operate on the
* listener's reference to the taskprocessor.
*
* \param listener The listener
*/
void (*shutdown)(struct ast_taskprocessor_listener *listener);
/*!
* \brief Destroy the listener's private data
*