[asterisk-commits] mmichelson: branch mmichelson/threadpool r377377 - /team/mmichelson/threadpoo...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Dec 7 13:05:36 CST 2012
Author: mmichelson
Date: Fri Dec 7 13:05:30 2012
New Revision: 377377
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=377377
Log:
Fix infinite looping and crash problem.
MALLOC_DEBUG is complaining about corrupted memory on taskprocessor
listeners, but I'm not seeing it, nor is valgrind. Not sure what's up
there.
Modified:
team/mmichelson/threadpool/main/taskprocessor.c
team/mmichelson/threadpool/main/threadpool.c
Modified: team/mmichelson/threadpool/main/taskprocessor.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/threadpool/main/taskprocessor.c?view=diff&rev=377377&r1=377376&r2=377377
==============================================================================
--- team/mmichelson/threadpool/main/taskprocessor.c (original)
+++ team/mmichelson/threadpool/main/taskprocessor.c Fri Dec 7 13:05:30 2012
@@ -581,8 +581,6 @@
/* decrement the taskprocessor reference count and unlink from the container if necessary */
void *ast_taskprocessor_unreference(struct ast_taskprocessor *tps)
{
- struct ast_taskprocessor_listener *listener;
-
if (!tps) {
return NULL;
}
@@ -596,10 +594,7 @@
* 3. The listener
*/
ao2_unlink(tps_singletons, tps);
- listener = tps->listener;
- tps->listener = NULL;
- listener_shutdown(listener);
- ao2_ref(listener, -1);
+ listener_shutdown(tps->listener);
return NULL;
}
Modified: team/mmichelson/threadpool/main/threadpool.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/threadpool/main/threadpool.c?view=diff&rev=377377&r1=377376&r2=377377
==============================================================================
--- team/mmichelson/threadpool/main/threadpool.c (original)
+++ team/mmichelson/threadpool/main/threadpool.c Fri Dec 7 13:05:30 2012
@@ -784,7 +784,7 @@
{
int alive = 1;
while (alive) {
- if (threadpool_execute(worker->pool)) {
+ if (threadpool_execute(worker->pool) == 0) {
alive = worker_idle(worker);
}
}
More information about the asterisk-commits
mailing list