Do not invoke processor restart() if not required
authorMartin Willi <martin@revosec.ch>
Tue, 15 Mar 2011 10:48:19 +0000 (11:48 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 15 Mar 2011 10:48:19 +0000 (11:48 +0100)
Doing so might result in a deadlock during shutdown if a delayed
restart is locked on the bus during the debug statement.

src/libstrongswan/processing/processor.c

index 723aec9..3d28ff1 100644 (file)
@@ -136,8 +136,9 @@ static void process_jobs(private_processor_t *this)
                thread_cleanup_pop(FALSE);
                this->mutex->lock(this->mutex);
        }
+       this->total_threads--;
+       this->thread_terminated->signal(this->thread_terminated);
        this->mutex->unlock(this->mutex);
-       restart(this);
 }
 
 /**