diff options
Diffstat (limited to 'src/lib/encode_server.cc')
| -rw-r--r-- | src/lib/encode_server.cc | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/lib/encode_server.cc b/src/lib/encode_server.cc index 8db3f867c..c242cb216 100644 --- a/src/lib/encode_server.cc +++ b/src/lib/encode_server.cc @@ -87,14 +87,9 @@ EncodeServer::~EncodeServer () _full_condition.notify_all (); } - BOOST_FOREACH (boost::thread* i, _worker_threads) { - try { - i->join (); - } catch (...) { - - } - delete i; - } + try { + _worker_threads.join_all (); + } catch (...) {} { boost::mutex::scoped_lock lm (_broadcast.mutex); @@ -241,8 +236,7 @@ EncodeServer::run () } for (int i = 0; i < _num_threads; ++i) { - boost::thread* t = new thread(bind(&EncodeServer::worker_thread, this)); - _worker_threads.push_back (t); + boost::thread* t = _worker_threads.create_thread (bind(&EncodeServer::worker_thread, this)); #ifdef DCPOMATIC_LINUX pthread_setname_np (t->native_handle(), "encode-server-worker"); #endif |
