diff options
author | Tobias Brunner <tobias@strongswan.org> | 2009-12-17 15:58:12 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2009-12-23 17:03:41 +0100 |
commit | 4a5a5dd2900ed3b58381854e2c04ef23cd105645 (patch) | |
tree | 7f6b58cb8e1959731f8cb22746064ad2659260c3 /src/charon/processing/scheduler.c | |
parent | c48eea920334488eb4fcc208cc0ba68b6989c045 (diff) | |
download | strongswan-4a5a5dd2900ed3b58381854e2c04ef23cd105645.tar.bz2 strongswan-4a5a5dd2900ed3b58381854e2c04ef23cd105645.tar.xz |
Using the thread wrapper in charon, libstrongswan and their plugins.
Diffstat (limited to 'src/charon/processing/scheduler.c')
-rw-r--r-- | src/charon/processing/scheduler.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/charon/processing/scheduler.c b/src/charon/processing/scheduler.c index 69c54900c..345af502a 100644 --- a/src/charon/processing/scheduler.c +++ b/src/charon/processing/scheduler.c @@ -16,13 +16,14 @@ */ #include <stdlib.h> -#include <pthread.h> #include "scheduler.h" #include <daemon.h> #include <processing/processor.h> #include <processing/jobs/callback_job.h> +#include <threading/thread.h> +#include <threading/condvar.h> #include <threading/mutex.h> /* the initial size of the heap */ @@ -185,8 +186,7 @@ static job_requeue_t schedule(private_scheduler_t * this) { timeval_t now; event_t *event; - int oldstate; - bool timed = FALSE; + bool timed = FALSE, oldstate; this->mutex->lock(this->mutex); @@ -215,8 +215,8 @@ static job_requeue_t schedule(private_scheduler_t * this) } timed = TRUE; } - pthread_cleanup_push((void*)this->mutex->unlock, this->mutex); - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &oldstate); + thread_cleanup_push((thread_cleanup_t)this->mutex->unlock, this->mutex); + oldstate = thread_cancelability(TRUE); if (timed) { @@ -227,8 +227,8 @@ static job_requeue_t schedule(private_scheduler_t * this) DBG2(DBG_JOB, "no events, waiting"); this->condvar->wait(this->condvar, this->mutex); } - pthread_setcancelstate(oldstate, NULL); - pthread_cleanup_pop(TRUE); + thread_cancelability(oldstate); + thread_cleanup_pop(TRUE); return JOB_REQUEUE_DIRECT; } |