diff options
author | Martin Willi <martin@revosec.ch> | 2013-07-18 11:37:42 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2013-07-18 16:00:31 +0200 |
commit | 6653e6c13e61da0753625af13de62c46d1ceeb48 (patch) | |
tree | fae7def33a3e4163050ebf1709353ed1ca7b1493 /src/libstrongswan/processing/processor.h | |
parent | 55240835b0562a35025d261d85dd2bb04446d350 (diff) | |
download | strongswan-6653e6c13e61da0753625af13de62c46d1ceeb48.tar.bz2 strongswan-6653e6c13e61da0753625af13de62c46d1ceeb48.tar.xz |
processor: add an execute_job() method to directly execute an important job
If all worker threads are busy and waiting for an event, we must ensure that
a job delivering that event gets executed. This new method has this property
for CRITICAL jobs, using a worker if we have one, but executing the job directly
if not.
Diffstat (limited to 'src/libstrongswan/processing/processor.h')
-rw-r--r-- | src/libstrongswan/processing/processor.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libstrongswan/processing/processor.h b/src/libstrongswan/processing/processor.h index bd708fba8..c691cfb60 100644 --- a/src/libstrongswan/processing/processor.h +++ b/src/libstrongswan/processing/processor.h @@ -75,6 +75,16 @@ struct processor_t { void (*queue_job) (processor_t *this, job_t *job); /** + * Directly execute a job with an idle worker thread. + * + * If no idle thread is available, the job gets executed by the calling + * thread. + * + * @param job job, gets destroyed + */ + void (*execute_job)(processor_t *this, job_t *job); + + /** * Set the number of threads to use in the processor. * * If the number of threads is smaller than number of currently running |