Make terminate_threads() less likely to leave _threads containing invalid pointers.
[dcpomatic.git] / src / lib / json_server.cc
index e171a630700252cb1377277e55ff6851c3f891df..3f43a75eb8ee332a53d0a1bac1cb0e2ecc6e1dd0 100644 (file)
@@ -52,7 +52,10 @@ enum State {
 
 JSONServer::JSONServer (int port)
 {
-       new thread (boost::bind (&JSONServer::run, this, port));
+       thread* t = new thread (boost::bind (&JSONServer::run, this, port));
+#ifdef DCPOMATIC_LINUX
+       pthread_setname_np (t->native_handle(), "json-server");
+#endif
 }
 
 void