summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-05-14 00:27:53 +0100
committerCarl Hetherington <cth@carlh.net>2016-05-14 00:27:53 +0100
commita41bbfb1db5ad7c91b566c0bd52ea713198b45d3 (patch)
tree5786af4d3d9cf053498e318e94ee89361157485a /src/lib
parent826e8d5471665593a90951f2866d7dc5bf4c9118 (diff)
Fix hang when examining content containing subtitles.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/signaller.h12
1 files changed, 11 insertions, 1 deletions
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;
}