From: Martin Willi Date: Thu, 18 Jul 2013 09:40:40 +0000 (+0200) Subject: watcher: use processors new execute_job() to notify FDs X-Git-Tag: 5.1.0rc1~10^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea009869e9e5cc914c5ce98261351029c7ab079e;p=thirdparty%2Fstrongswan.git watcher: use processors new execute_job() to notify FDs Just queueing is problematic, as all threads might be busy waiting for events that the queued (but never executed) job delivers. --- diff --git a/src/libstrongswan/processing/watcher.c b/src/libstrongswan/processing/watcher.c index 9e02a1b493..69cb3c8f53 100644 --- a/src/libstrongswan/processing/watcher.c +++ b/src/libstrongswan/processing/watcher.c @@ -325,15 +325,7 @@ static job_requeue_t watch(private_watcher_t *this) while (this->jobs->remove_first(this->jobs, (void**)&job) == SUCCESS) { - if (lib->processor->get_threads(lib->processor)) - { - lib->processor->queue_job(lib->processor, job); - } - else - { - job->execute(job); - job->destroy(job); - } + lib->processor->execute_job(lib->processor, job); } /* we temporarily disable a notified FD, rebuild FDSET */ return JOB_REQUEUE_DIRECT;