From a41bbfb1db5ad7c91b566c0bd52ea713198b45d3 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 14 May 2016 00:27:53 +0100 Subject: Fix hang when examining content containing subtitles. --- src/lib/signaller.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/signaller.h b/src/lib/signaller.h index 13474ee91..c6037deaa 100644 --- a/src/lib/signaller.h +++ b/src/lib/signaller.h @@ -41,7 +41,17 @@ public: } bool finished () const { - boost::mutex::scoped_lock lm (_mutex); + boost::mutex::scoped_lock lm (_mutex, boost::try_to_lock); + if (!lm) { + /* It's possible that emission of this + wrapper's signal causes another signal to + be emitted, which causes finished() on this + wrapper to be called (by Signaller::emit). + In this case, just say that the wrapper is + not yet finished. + */ + return false; + } return _finished; } -- cgit v1.2.3