Fix encoder thread interruption.
authorCarl Hetherington <cth@carlh.net>
Mon, 20 Jun 2016 16:15:07 +0000 (17:15 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 20 Jun 2016 16:15:07 +0000 (17:15 +0100)
When an encoder thread is interrupted we just want it silently
to stop, so catch boost::thread_interrupted separately and don't
pass it on.

I believe the interruption of jobs and subsequent catch of
boost::thread_interrupted will still work as that's the job thread
rather than the encoder threads.

src/lib/encoder.cc

index 9ec817604a34e09ca98dc0c8dfb24a5f1606a441..fbc5c3561114f58de84da9781606e130d9fd8c73 100644 (file)
@@ -360,6 +360,10 @@ try
                _full_condition.notify_all ();
        }
 }
+catch (boost::thread_interrupted& e) {
+       /* Ignore these and just stop the thread */
+       _full_condition.notify_all ();
+}
 catch (...)
 {
        store_current ();