Threadpool fix; I think this is right; fatpelt may continue to disagree :)

This commit is contained in:
alexhudson
2009-11-24 22:09:20 +00:00
parent 39217f929a
commit eeb22dd9cb
+3 -4
View File
@@ -191,10 +191,6 @@ BongoThreadPoolAddWork(BongoThreadPool *pool,
pool->head = item;
}
XplMutexUnlock(pool->lock);
XplSignalLocalSemaphore(pool->todo);
/* Possibly spawn a worker */
if (spawnThread && (pool->total < pool->maximum)) {
XplThreadID id;
@@ -204,6 +200,9 @@ BongoThreadPoolAddWork(BongoThreadPool *pool,
ret = 0;
}
XplMutexUnlock(pool->lock);
XplSignalLocalSemaphore(pool->todo);
return ret;
}