Add new threadpool test and fix some taskprocessor bugs.

The new thread creation test fails because Asterisk locks up
while trying to lock a taskprocessor.

While trying to debug that, I found a race condition during taskprocessor
creation where a default taskprocessor listener could try to operate on
a partially started taskprocessor. This was fixed by adding a new callback
to taskprocessor listeners.

Then while testing that change, I found some bugs in the taskprocessor
tests where I was not properly unlocking when done with a lock. Scoped
locks have spoiled me a bit.

I still have not figured out why the threadpool thread creation test
is locking up.



git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2012-12-07 00:30:35 +00:00
parent 62981d2032
commit 4590bfd93d
5 changed files with 106 additions and 3 deletions

View File

@@ -84,6 +84,15 @@ struct ast_taskprocessor_listener_callbacks {
* \retval non-NULL Allocated private data
*/
void *(*alloc)(struct ast_taskprocessor_listener *listener);
/*!
* \brief The taskprocessor has started completely
*
* This indicates that the taskprocessor is fully set up and the listener
* can now start interacting with it.
*
* \param listener The listener to start
*/
int (*start)(struct ast_taskprocessor_listener *listener);
/*!
* \brief Indicates a task was pushed to the processor
*