aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/charon/processing/processor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/charon/processing/processor.c b/src/charon/processing/processor.c
index a5f1833c0..156c65b8e 100644
--- a/src/charon/processing/processor.c
+++ b/src/charon/processing/processor.c
@@ -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--;