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 <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-01-27 16:02:52 +00:00
parent 9a7bf70365
commit 73f574945f
1 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,7 @@
#include <unistd.h>
#include <pthread.h>
#include <signal.h>
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) {