I think it's ok and less crash-prone to check joinable() rather
authorCarl Hetherington <cth@carlh.net>
Mon, 30 Nov 2015 11:50:40 +0000 (11:50 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 30 Nov 2015 11:50:40 +0000 (11:50 +0000)
than asserting it; I have seen traces which suggest the assert
might be triggering.  In an ideal world we would track down
why that's happening.

src/lib/writer.cc

index 17bd21daf6cb61b0bef42cd6c0167a5166f33aad..7381d2a904bdf74ae0aebbf250b8e38b8ef53dd4 100644 (file)
@@ -429,8 +429,10 @@ Writer::terminate_thread (bool can_throw)
        _full_condition.notify_all ();
        lock.unlock ();
 
-       DCPOMATIC_ASSERT (_thread->joinable ());
-       _thread->join ();
+       if (_thread->joinable ()) {
+               _thread->join ();
+       }
+
        if (can_throw) {
                rethrow ();
        }