diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-05-14 00:27:53 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-05-14 00:27:53 +0100 |
| commit | a41bbfb1db5ad7c91b566c0bd52ea713198b45d3 (patch) | |
| tree | 5786af4d3d9cf053498e318e94ee89361157485a /src | |
| parent | 826e8d5471665593a90951f2866d7dc5bf4c9118 (diff) | |
Fix hang when examining content containing subtitles.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/signaller.h | 12 |
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; } |
