do not respawn cancelled threads if we are shutting down

This commit is contained in:
Martin Willi
2008-12-12 15:57:12 +00:00
parent 248a1f57bb
commit 50901d2550
+3 -1
View File
@@ -84,7 +84,9 @@ static void restart(private_processor_t *this)
{
pthread_t thread;
if (pthread_create(&thread, NULL, (void*)process_jobs, this) != 0)
/* respawn thread if required */
if (this->desired_threads == 0 ||
pthread_create(&thread, NULL, (void*)process_jobs, this) != 0)
{
this->mutex->lock(this->mutex);
this->total_threads--;