diff options
Diffstat (limited to 'evtp.c')
-rw-r--r-- | evtp.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -32,6 +32,7 @@ #include <errno.h> #include <assert.h> #include <pthread.h> +#include <signal.h> typedef struct evtp_queue_t { @@ -161,11 +162,18 @@ static int evtp_spawn(evtp_t *tp) { tp->kill--; return 1; } - pthread_t thread; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + + sigset_t fullset, oldset; + sigfillset(&fullset); + + pthread_t thread; + pthread_sigmask(SIG_SETMASK, &fullset, &oldset); int r = pthread_create(&thread, &attr, evtp_thread, tp); + pthread_sigmask(SIG_SETMASK, &oldset, NULL); + if(r) { errno = r; return tp->threads ? 0 : -1; |