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 ();
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)
{
{
boost::mutex::scoped_lock lm (_progress_mutex);
+ LOG_GENERAL ("Sub-job %1 starting", n);
_sub_name = n;
}