Use thread_group for improved exception safety (#1785).
[dcpomatic.git] / src / lib / j2k_encoder.h
index b4542c40a147cca4ccbc62b39f340a5f6a660afe..d56fc1aecd19576c15c96525ce77193fff66d9f9 100644 (file)
@@ -87,9 +87,8 @@ private:
 
        EventHistory _history;
 
-       /** Mutex for _threads */
-       mutable boost::mutex _threads_mutex;
-       std::list<boost::thread*> _threads;
+       boost::shared_ptr<boost::thread_group> _threads;
+
        mutable boost::mutex _queue_mutex;
        std::list<boost::shared_ptr<DCPVideo> > _queue;
        /** condition to manage thread wakeups when we have nothing to do */