Rename shared_path -> resources_path.
[dcpomatic.git] / src / lib / encode_server.cc
index 61e0b09c58f1a340460791c02c7ead7aef417b8a..f4224798bce211f423574aed7c0496ecb1e0958e 100644 (file)
@@ -83,6 +83,8 @@ EncodeServer::EncodeServer (bool verbose, int num_threads)
 
 EncodeServer::~EncodeServer ()
 {
+       boost::this_thread::disable_interruption dis;
+
        {
                boost::mutex::scoped_lock lm (_mutex);
                _terminate = true;
@@ -104,13 +106,9 @@ EncodeServer::~EncodeServer ()
        }
 
        _broadcast.io_service.stop ();
-       if (_broadcast.thread.joinable()) {
-               try {
-                       _broadcast.thread.join ();
-               } catch (...) {
-
-               }
-       }
+       try {
+               _broadcast.thread.join ();
+       } catch (...) {}
 }
 
 /** @param after_read Filled in with gettimeofday() after reading the input from the network.
@@ -239,9 +237,11 @@ EncodeServer::run ()
        }
 
        for (int i = 0; i < _num_threads; ++i) {
-               boost::thread* t = _worker_threads.create_thread (bind(&EncodeServer::worker_thread, this));
 #ifdef DCPOMATIC_LINUX
+               boost::thread* t = _worker_threads.create_thread (bind(&EncodeServer::worker_thread, this));
                pthread_setname_np (t->native_handle(), "encode-server-worker");
+#else
+               _worker_threads.create_thread (bind(&EncodeServer::worker_thread, this));
 #endif
        }