Name threads on Linux.
[dcpomatic.git] / src / lib / encode_server.cc
index 332c7ab46d34c858a5ee60e78415b6fe7abd293d..26ef45d60786115e51c166b615c10a116c74e0d7 100644 (file)
@@ -229,10 +229,17 @@ EncodeServer::run ()
        }
 
        for (int i = 0; i < _num_threads; ++i) {
-               _worker_threads.push_back (new thread (bind (&EncodeServer::worker_thread, this)));
+               thread* t = new thread (bind (&EncodeServer::worker_thread, this));
+#ifdef DCPOMATIC_LINUX
+               pthread_setname_np (t->native_handle(), "encode-server-worker");
+#endif
+               _worker_threads.push_back (t);
        }
 
        _broadcast.thread = new thread (bind (&EncodeServer::broadcast_thread, this));
+#ifdef DCPOMATIC_LINUX
+       pthread_setname_np (_broadcast.thread->native_handle(), "encode-server-broadcast");
+#endif
 
        Server::run ();
 }