More debugging.
authorCarl Hetherington <cth@carlh.net>
Wed, 9 Dec 2015 15:16:16 +0000 (15:16 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 9 Dec 2015 15:16:16 +0000 (15:16 +0000)
src/lib/encoder.cc
src/lib/job.cc

index 00d6e63996c96c41717a3ec76d00efb8590c57b3..e7277d0dd41bc36a2851d802b11e63f83317f956 100644 (file)
@@ -260,12 +260,16 @@ Encoder::terminate_threads ()
 
        boost::mutex::scoped_lock threads_lock (_threads_mutex);
 
+       int n = 0;
        for (list<boost::thread *>::iterator i = _threads.begin(); i != _threads.end(); ++i) {
+               LOG_GENERAL ("Terminating thread %1 of %2", n + 1, _threads.size ());
                (*i)->interrupt ();
                if ((*i)->joinable ()) {
                        (*i)->join ();
                }
                delete *i;
+               LOG_GENERAL_NC ("Thread terminated");
+               ++n;
        }
 
        _threads.clear ();
index 35f5834080af4ab9de1f876a52656961631532c9..6ba6a3e1a35c6be4880df3dfb16e0f53ddc1d37d 100644 (file)
@@ -43,6 +43,7 @@ using boost::optional;
 using boost::function;
 
 #define LOG_ERROR_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_ERROR);
+#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
 
 /** @param film Associated film, or 0 */
 Job::Job (shared_ptr<const Film> film)
@@ -295,6 +296,7 @@ Job::sub (string n)
 {
        {
                boost::mutex::scoped_lock lm (_progress_mutex);
+               LOG_GENERAL ("Sub-job %1 starting", n);
                _sub_name = n;
        }