From: Martin Willi Date: Fri, 19 Jul 2013 13:27:07 +0000 (+0200) Subject: processor: force synchronous execute_job() if set_threads(0) has been called X-Git-Tag: 5.1.0rc1~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcd5129c2524401ebc0e566bfd389157e61d31f6;p=thirdparty%2Fstrongswan.git processor: force synchronous execute_job() if set_threads(0) has been called During daemon shutdown, some idle threads might be lingering around even if set_threads(0) already has been called. To avoid any races, we enforce synchronous execution of the job. --- diff --git a/src/libstrongswan/processing/processor.c b/src/libstrongswan/processing/processor.c index e00216e07d..adbd956859 100644 --- a/src/libstrongswan/processing/processor.c +++ b/src/libstrongswan/processing/processor.c @@ -408,7 +408,7 @@ METHOD(processor_t, execute_job, void, bool queued = FALSE; this->mutex->lock(this->mutex); - if (get_idle_threads_nolock(this)) + if (this->desired_threads && get_idle_threads_nolock(this)) { prio = sane_prio(job->get_priority(job)); job->status = JOB_STATUS_QUEUED;