[Spice-commits] server/red-worker.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Thu Aug 31 16:36:43 UTC 2017


 server/red-worker.c |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit f712f2637db7ea518a9a2c2812dbf9cbd5c45edb
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu Aug 31 14:43:19 2017 +0100

    red-worker: Set thread name if possible
    
    Name will be visible in debugger and /proc filesystem
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/server/red-worker.c b/server/red-worker.c
index 9c97f499..4d8566be 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -19,6 +19,7 @@
 #include <config.h>
 #endif
 
+#define _GNU_SOURCE
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdlib.h>
@@ -1397,6 +1398,7 @@ bool red_worker_run(RedWorker *worker)
         spice_error("create thread failed %d", r);
     }
     pthread_sigmask(SIG_SETMASK, &curr_sig_mask, NULL);
+    pthread_setname_np(worker->thread, "SPICE Worker");
 
     return r == 0;
 }


More information about the Spice-commits mailing list