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.
This commit is contained in:
Martin Willi
2013-07-19 15:30:22 +02:00
parent 2fa92ad256
commit dcd5129c25
+1 -1
View File
@@ -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;