Add new threadpool test and fix some taskprocessor bugs.
authorMark Michelson <mmichelson@digium.com>
Fri, 7 Dec 2012 00:30:35 +0000 (00:30 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 7 Dec 2012 00:30:35 +0000 (00:30 +0000)
commit4590bfd93d7124fbd042f17260738e315e0abb6e
tree1579fa64689d9d5da754444e4ba41a9bc6c3f4a4
parent62981d203221541829b7d6165e2127ca9a29efd4
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
include/asterisk/taskprocessor.h
main/taskprocessor.c
main/threadpool.c
tests/test_taskprocessor.c
tests/test_threadpool.c