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/plugins/stroke/stroke_socket.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/plugins/stroke/stroke_socket.c')
-rw-r--r-- | src/charon/plugins/stroke/stroke_socket.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/charon/plugins/stroke/stroke_socket.c b/src/charon/plugins/stroke/stroke_socket.c index 6a599992e..820e097f1 100644 --- a/src/charon/plugins/stroke/stroke_socket.c +++ b/src/charon/plugins/stroke/stroke_socket.c @@ -23,11 +23,10 @@ #include <sys/fcntl.h> #include <unistd.h> #include <errno.h> -#include <pthread.h> #include <processing/jobs/callback_job.h> #include <daemon.h> -#include <threading/mutex.h> /* for Mac OS X compatible accept */ +#include <threading/thread.h> #include "stroke_config.h" #include "stroke_control.h" @@ -547,13 +546,13 @@ static job_requeue_t receive(private_stroke_socket_t *this) struct sockaddr_un strokeaddr; int strokeaddrlen = sizeof(strokeaddr); int strokefd; - int oldstate; + bool oldstate; callback_job_t *job; stroke_job_context_t *ctx; - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &oldstate); + oldstate = thread_cancelability(TRUE); strokefd = accept(this->socket, (struct sockaddr *)&strokeaddr, &strokeaddrlen); - pthread_setcancelstate(oldstate, NULL); + thread_cancelability(oldstate); if (strokefd < 0) { |