while (1) {
- TIMING ("encoder thread %1 sleeps", pthread_self ());
+ TIMING ("encoder thread %1 sleeps", boost::this_thread::get_id());
boost::mutex::scoped_lock lock (_worker_mutex);
while (_queue.empty () && !_process_end) {
_worker_condition.wait (lock);
return;
}
- TIMING ("encoder thread %1 wakes with queue of %2", pthread_self(), _queue.size());
+ TIMING ("encoder thread %1 wakes with queue of %2", boost::this_thread::get_id(), _queue.size());
boost::shared_ptr<DCPVideoFrame> vf = _queue.front ();
- _log->log (String::compose ("Encoder thread %1 pops frame %2 from queue", pthread_self(), vf->frame()));
+ _log->log (String::compose ("Encoder thread %1 pops frame %2 from queue", boost::this_thread::get_id(), vf->frame()));
_queue.pop_front ();
lock.unlock ();
} else {
try {
- TIMING ("encoder thread %1 begins local encode of %2", pthread_self(), vf->frame());
+ TIMING ("encoder thread %1 begins local encode of %2", boost::this_thread::get_id(), vf->frame());
encoded = vf->encode_locally ();
- TIMING ("encoder thread %1 finishes local encode of %2", pthread_self(), vf->frame());
+ TIMING ("encoder thread %1 finishes local encode of %2", boost::this_thread::get_id(), vf->frame());
} catch (std::exception& e) {
_log->log (String::compose ("Local encode failed (%1)", e.what ()));
}
frame_done (vf->frame ());
} else {
lock.lock ();
- _log->log (String::compose ("Encoder thread %1 pushes frame %2 back onto queue after failure", pthread_self(), vf->frame()));
+ _log->log (String::compose ("Encoder thread %1 pushes frame %2 back onto queue after failure", boost::this_thread::get_id(), vf->frame()));
_queue.push_front (vf);
lock.unlock ();
}
#include "dcp_video_frame.h"
#include "config.h"
#include "server.h"
+#include "cross.h"
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE dvdomatic_test
#include <boost/test/unit_test.hpp>
film.make_dcp (true);
while (JobManager::instance()->work_to_do ()) {
- sleep (1);
+ dvdomatic_sleep (1);
}
BOOST_CHECK_EQUAL (JobManager::instance()->errors(), false);
film.make_dcp (true);
while (JobManager::instance()->work_to_do ()) {
- sleep (1);
+ dvdomatic_sleep (1);
}
BOOST_CHECK_EQUAL (JobManager::instance()->errors(), false);