From 73f574945f2cac14f9bafa6395e2c4dbb16fcf5d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 27 Jan 2013 16:02:52 +0000 Subject: [PATCH] sna: Disable all signals in the render threads X uses them (SIGIO especially) for input handling, and gets rightfully confused if it finds itself in a different thread. Signed-off-by: Chris Wilson --- src/sna/sna_threads.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sna/sna_threads.c b/src/sna/sna_threads.c index 4a98753f..f77ddbfe 100644 --- a/src/sna/sna_threads.c +++ b/src/sna/sna_threads.c @@ -29,6 +29,7 @@ #include #include +#include static int max_threads = -1; @@ -44,6 +45,11 @@ static struct thread { static void *__run__(void *arg) { struct thread *t = arg; + sigset_t signals; + + /* Disable all signals in the slave threads as X uses them for IO */ + sigfillset(&signals); + pthread_sigmask(SIG_BLOCK, &signals, NULL); pthread_mutex_lock(&t->mutex); while (1) {