From 5395f0b529b4127feffff310dbe648ffc0eb5aa3 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 23 Sep 2012 20:13:04 +0100 Subject: Add some more logging when finishing up an encode. --- src/lib/j2k_wav_encoder.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/lib/j2k_wav_encoder.cc b/src/lib/j2k_wav_encoder.cc index ef1e8edc1..9ae01c774 100644 --- a/src/lib/j2k_wav_encoder.cc +++ b/src/lib/j2k_wav_encoder.cc @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include "j2k_wav_encoder.h" @@ -229,8 +230,11 @@ J2KWAVEncoder::process_end () { boost::mutex::scoped_lock lock (_worker_mutex); + _log->log ("Clearing queue of " + lexical_cast (_queue.size ())); + /* Keep waking workers until the queue is empty */ while (!_queue.empty ()) { + _log->log ("Waking with " + lexical_cast (_queue.size ())); _worker_condition.notify_all (); _worker_condition.wait (lock); } @@ -239,6 +243,8 @@ J2KWAVEncoder::process_end () terminate_worker_threads (); + _log->log ("Mopping up " + lexical_cast (_queue.size())); + /* The following sequence of events can occur in the above code: 1. a remote worker takes the last image off the queue 2. the loop above terminates -- cgit v1.2.3