summaryrefslogtreecommitdiff
path: root/src/lib/encoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-12-09 14:29:47 +0000
committerCarl Hetherington <cth@carlh.net>2015-12-09 14:29:47 +0000
commitb30d41f0dd8d7e1efb8f5557cf503c35a7d309b2 (patch)
tree119a5daaf21bb7abd81da2a6a4a2a754791b4fc5 /src/lib/encoder.cc
parent5fb50255aae4385f0443cd734e5dcdef270acc12 (diff)
Try to speed up cancel of encoder threads if they are sleeping for remote backoff.
Diffstat (limited to 'src/lib/encoder.cc')
-rw-r--r--src/lib/encoder.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc
index b03a2ce6a..451a5a31a 100644
--- a/src/lib/encoder.cc
+++ b/src/lib/encoder.cc
@@ -257,13 +257,12 @@ Encoder::terminate_threads ()
{
boost::mutex::scoped_lock queue_lock (_queue_mutex);
_terminate_encoding = true;
- _full_condition.notify_all ();
- _empty_condition.notify_all ();
}
boost::mutex::scoped_lock threads_lock (_threads_mutex);
for (list<boost::thread *>::iterator i = _threads.begin(); i != _threads.end(); ++i) {
+ (*i)->interrupt ();
if ((*i)->joinable ()) {
(*i)->join ();
}
@@ -356,7 +355,7 @@ try
}
if (remote_backoff > 0) {
- dcpomatic_sleep (remote_backoff);
+ boost::this_thread::sleep_for (boost::chrono::seconds (remote_backoff));
}
/* The queue might not be full any more, so notify anything that is waiting on that */