From: Carl Hetherington Date: Tue, 9 Oct 2012 20:58:05 +0000 (+0100) Subject: Fix some POSIX-isms. X-Git-Tag: v2.0.48~1717^2~2 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=b03b2c447a8ed9f855d09a62609ca03cc705fdbf;p=dcpomatic.git Fix some POSIX-isms. --- diff --git a/src/lib/j2k_wav_encoder.cc b/src/lib/j2k_wav_encoder.cc index 2f892948d..a1f70a08a 100644 --- a/src/lib/j2k_wav_encoder.cc +++ b/src/lib/j2k_wav_encoder.cc @@ -149,7 +149,7 @@ J2KWAVEncoder::encoder_thread (ServerDescription* server) 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); @@ -159,9 +159,9 @@ J2KWAVEncoder::encoder_thread (ServerDescription* server) 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 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 (); @@ -193,9 +193,9 @@ J2KWAVEncoder::encoder_thread (ServerDescription* server) } 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 ())); } @@ -206,7 +206,7 @@ J2KWAVEncoder::encoder_thread (ServerDescription* server) 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 (); } diff --git a/test/test.cc b/test/test.cc index d978d36a0..26bca33e5 100644 --- a/test/test.cc +++ b/test/test.cc @@ -34,6 +34,7 @@ #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 @@ -333,7 +334,7 @@ BOOST_AUTO_TEST_CASE (make_dcp_test) film.make_dcp (true); while (JobManager::instance()->work_to_do ()) { - sleep (1); + dvdomatic_sleep (1); } BOOST_CHECK_EQUAL (JobManager::instance()->errors(), false); @@ -357,7 +358,7 @@ BOOST_AUTO_TEST_CASE (make_dcp_with_range_test) film.make_dcp (true); while (JobManager::instance()->work_to_do ()) { - sleep (1); + dvdomatic_sleep (1); } BOOST_CHECK_EQUAL (JobManager::instance()->errors(), false);