aboutsummaryrefslogtreecommitdiffhomepage
path: root/iothread.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-01-22 21:40:08 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-01-22 21:40:08 -0800
commitb43c8da66b3b215690bef5d9814e92bf23b4ba7b (patch)
treeec4ddacaa9ca5105f053cac5907aa669fc3ab24b /iothread.cpp
parentda85bdc4012fb5a5e7ffffe61381fb9ba742958b (diff)
More work towards instanced parser. First successful compilation
Diffstat (limited to 'iothread.cpp')
-rw-r--r--iothread.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/iothread.cpp b/iothread.cpp
index 3f83c9e5..703fda5e 100644
--- a/iothread.cpp
+++ b/iothread.cpp
@@ -6,6 +6,7 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
+#include <signal.h>
#define VOMIT_ON_FAILURE(a) do { if (0 != (a)) { int err = errno; fprintf(stderr, "%s failed on line %d in file %s: %d (%s)\n", #a, __LINE__, __FILE__, err, strerror(err)); abort(); }} while (0)
@@ -90,6 +91,11 @@ static void *iothread_worker(void *threadPtr) {
assert(threadPtr != NULL);
struct WorkerThread_t *thread = (struct WorkerThread_t *)threadPtr;
+ // We don't want to receive signals on this thread
+ sigset_t set;
+ sigfillset(&set);
+ VOMIT_ON_FAILURE(pthread_sigmask(SIG_SETMASK, &set, NULL));
+
/* Grab a request off of the queue */
struct ThreadedRequest_t *req;
VOMIT_ON_FAILURE(pthread_mutex_lock(&s_request_queue_lock));