diff options
author | Mark Michelson <mmichelson@digium.com> | 2012-12-07 00:30:35 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2012-12-07 00:30:35 +0000 |
commit | 4590bfd93d7124fbd042f17260738e315e0abb6e (patch) | |
tree | 1579fa64689d9d5da754444e4ba41a9bc6c3f4a4 /include | |
parent | 62981d203221541829b7d6165e2127ca9a29efd4 (diff) |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/taskprocessor.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asterisk/taskprocessor.h b/include/asterisk/taskprocessor.h index 6359c057e..4f61939f8 100644 --- a/include/asterisk/taskprocessor.h +++ b/include/asterisk/taskprocessor.h @@ -85,6 +85,15 @@ struct ast_taskprocessor_listener_callbacks { */ 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 * * \param listener The listener |