summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-11-21 23:35:56 +0100
committerCarl Hetherington <cth@carlh.net>2021-11-25 00:55:02 +0100
commit6164b01cd8221620de68d3b0041cd3c08f6df52e (patch)
tree051fc8d11678518d52e211cf126a96141b28b08e
parent72ee4688cbaef0832eb44dee78063bbc0df97bf8 (diff)
Make sure exceptions are re-thrown even if they occur when the queue is full.
-rw-r--r--src/lib/j2k_encoder.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/j2k_encoder.cc b/src/lib/j2k_encoder.cc
index 70f3c32d4..27eeaa483 100644
--- a/src/lib/j2k_encoder.cc
+++ b/src/lib/j2k_encoder.cc
@@ -218,13 +218,16 @@ J2KEncoder::encode (shared_ptr<PlayerVideo> pv, DCPTime time)
LOG_TIMING ("decoder-sleep queue=%1 threads=%2", _queue.size(), threads);
_full_condition.wait (queue_lock);
LOG_TIMING ("decoder-wake queue=%1 threads=%2", _queue.size(), threads);
+ _writer->rethrow ();
+ /* Re-throw any exception raised by one of our threads. If more
+ than one has thrown an exception, only one will be rethrown, I think;
+ but then, if that happens something has gone badly wrong.
+ */
+ rethrow ();
}
+ /* Do it again in case an exception was thrown with an emptier queue */
_writer->rethrow ();
- /* Re-throw any exception raised by one of our threads. If more
- than one has thrown an exception, only one will be rethrown, I think;
- but then, if that happens something has gone badly wrong.
- */
rethrow ();
auto const position = time.frames_floor(_film->video_frame_rate());