sna: Propagate thread signals for extra DBG
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 22 Feb 2014 18:12:24 +0000 (18:12 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Sat, 22 Feb 2014 18:13:22 +0000 (18:13 +0000)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_threads.c

index eac6964..089d8ab 100644 (file)
@@ -187,9 +187,11 @@ void sna_threads_trap(int sig)
        for (n = 1; threads[n].thread != t; n++)
                ;
 
+       ERR(("%s: thread[%d] caught signal %d\n", __func__, n, sig));
+
        pthread_mutex_lock(&threads[n].mutex);
        threads[n].func = NULL;
-       threads[n].arg = &threads[n];
+       threads[n].arg = (void *)(intptr_t)sig;
        pthread_cond_signal(&threads[n].cond);
        pthread_mutex_unlock(&threads[n].mutex);
 
@@ -212,7 +214,7 @@ void sna_threads_wait(void)
                }
 
                if (threads[n].arg != NULL) {
-                       ERR(("%s: thread %d died\n", __func__, n));
+                       DBG(("%s: thread[%d] died from signal %d\n", __func__, n, (int)threads[n].arg));
                        sna_threads_kill();
                        return;
                }