From 82e2c82e95f3e45bee9920276db12bb043ebf94f Mon Sep 17 00:00:00 2001 From: Austin Beer Date: Mon, 2 Oct 2017 09:23:54 -0600 Subject: [PATCH] Renaming timespec to platform --- .../{timespec.hpp => platform_time.hpp} | 156 +++++++++--------- include/boost/thread/detail/thread.hpp | 38 ++--- include/boost/thread/future.hpp | 22 +-- .../thread/pthread/condition_variable.hpp | 58 +++---- .../thread/pthread/condition_variable_fwd.hpp | 56 +++---- include/boost/thread/pthread/mutex.hpp | 38 ++--- .../boost/thread/pthread/recursive_mutex.hpp | 38 ++--- include/boost/thread/pthread/shared_mutex.hpp | 108 ++++++------ include/boost/thread/pthread/thread_data.hpp | 20 +-- include/boost/thread/v2/shared_mutex.hpp | 10 +- .../boost/thread/win32/condition_variable.hpp | 70 ++++---- include/boost/thread/win32/thread_data.hpp | 34 ++-- src/pthread/thread.cpp | 26 +-- src/win32/thread.cpp | 32 ++-- 14 files changed, 353 insertions(+), 353 deletions(-) rename include/boost/thread/detail/{timespec.hpp => platform_time.hpp} (61%) diff --git a/include/boost/thread/detail/timespec.hpp b/include/boost/thread/detail/platform_time.hpp similarity index 61% rename from include/boost/thread/detail/timespec.hpp rename to include/boost/thread/detail/platform_time.hpp index a3796ed0..a63a8892 100644 --- a/include/boost/thread/detail/timespec.hpp +++ b/include/boost/thread/detail/platform_time.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_THREAD_DETAIL_TIMESPEC_HPP -#define BOOST_THREAD_DETAIL_TIMESPEC_HPP +#ifndef BOOST_THREAD_DETAIL_PLATFORM_TIME_HPP +#define BOOST_THREAD_DETAIL_PLATFORM_TIME_HPP // (C) Copyright 2007-8 Anthony Williams // (C) Copyright 2012 Vicente J. Botet Escriba // @@ -54,22 +54,22 @@ namespace boost } #endif - class timespec_duration + class platform_duration { public: #if defined BOOST_THREAD_PLATFORM_PTHREAD - explicit timespec_duration(timespec const& v) : ts_val(v) {} + explicit platform_duration(timespec const& v) : ts_val(v) {} inline timespec const& getTs() const { return ts_val; } - explicit timespec_duration(boost::intmax_t const& ns = 0) : ts_val(ns_to_timespec(ns)) {} + explicit platform_duration(boost::intmax_t const& ns = 0) : ts_val(ns_to_timespec(ns)) {} inline boost::intmax_t getNs() const { return timespec_to_ns(ts_val); } #else - explicit timespec_duration(boost::intmax_t const& ns = 0) : ns_val(ns) {} + explicit platform_duration(boost::intmax_t const& ns = 0) : ns_val(ns) {} inline boost::intmax_t getNs() const { return ns_val; } #endif #if defined BOOST_THREAD_USES_DATETIME - timespec_duration(boost::posix_time::time_duration const& rel_time) + platform_duration(boost::posix_time::time_duration const& rel_time) { #if defined BOOST_THREAD_PLATFORM_PTHREAD ts_val.tv_sec = rel_time.total_seconds(); @@ -83,7 +83,7 @@ namespace boost #if defined BOOST_THREAD_USES_CHRONO template - timespec_duration(chrono::duration const& d) + platform_duration(chrono::duration const& d) { #if defined BOOST_THREAD_PLATFORM_PTHREAD ts_val = ns_to_timespec(chrono::ceil(d).count()); @@ -109,9 +109,9 @@ namespace boost } } - static inline timespec_duration zero() + static inline platform_duration zero() { - return timespec_duration(0); + return platform_duration(0); } private: @@ -122,207 +122,207 @@ namespace boost #endif }; - inline bool operator==(timespec_duration const& lhs, timespec_duration const& rhs) + inline bool operator==(platform_duration const& lhs, platform_duration const& rhs) { return lhs.getNs() == rhs.getNs(); } - inline bool operator!=(timespec_duration const& lhs, timespec_duration const& rhs) + inline bool operator!=(platform_duration const& lhs, platform_duration const& rhs) { return lhs.getNs() != rhs.getNs(); } - inline bool operator<(timespec_duration const& lhs, timespec_duration const& rhs) + inline bool operator<(platform_duration const& lhs, platform_duration const& rhs) { return lhs.getNs() < rhs.getNs(); } - inline bool operator<=(timespec_duration const& lhs, timespec_duration const& rhs) + inline bool operator<=(platform_duration const& lhs, platform_duration const& rhs) { return lhs.getNs() <= rhs.getNs(); } - inline bool operator>(timespec_duration const& lhs, timespec_duration const& rhs) + inline bool operator>(platform_duration const& lhs, platform_duration const& rhs) { return lhs.getNs() > rhs.getNs(); } - inline bool operator>=(timespec_duration const& lhs, timespec_duration const& rhs) + inline bool operator>=(platform_duration const& lhs, platform_duration const& rhs) { return lhs.getNs() >= rhs.getNs(); } - static inline timespec_duration timespec_milliseconds(long const& ms) + static inline platform_duration platform_milliseconds(long const& ms) { - return timespec_duration(ms * 1000000l); + return platform_duration(ms * 1000000l); } - class real_timespec_timepoint + class real_platform_timepoint { public: #if defined BOOST_THREAD_PLATFORM_PTHREAD - explicit real_timespec_timepoint(timespec const& v) : dur(v) {} + explicit real_platform_timepoint(timespec const& v) : dur(v) {} inline timespec const& getTs() const { return dur.getTs(); } #endif - explicit real_timespec_timepoint(boost::intmax_t const& ns) : dur(ns) {} + explicit real_platform_timepoint(boost::intmax_t const& ns) : dur(ns) {} inline boost::intmax_t getNs() const { return dur.getNs(); } #if defined BOOST_THREAD_USES_DATETIME - real_timespec_timepoint(boost::system_time const& abs_time) + real_platform_timepoint(boost::system_time const& abs_time) : dur(abs_time - boost::posix_time::from_time_t(0)) {} #endif #if defined BOOST_THREAD_USES_CHRONO template - real_timespec_timepoint(chrono::time_point const& abs_time) + real_platform_timepoint(chrono::time_point const& abs_time) : dur(abs_time.time_since_epoch()) {} #endif private: - timespec_duration dur; + platform_duration dur; }; - inline bool operator==(real_timespec_timepoint const& lhs, real_timespec_timepoint const& rhs) + inline bool operator==(real_platform_timepoint const& lhs, real_platform_timepoint const& rhs) { return lhs.getNs() == rhs.getNs(); } - inline bool operator!=(real_timespec_timepoint const& lhs, real_timespec_timepoint const& rhs) + inline bool operator!=(real_platform_timepoint const& lhs, real_platform_timepoint const& rhs) { return lhs.getNs() != rhs.getNs(); } - inline bool operator<(real_timespec_timepoint const& lhs, real_timespec_timepoint const& rhs) + inline bool operator<(real_platform_timepoint const& lhs, real_platform_timepoint const& rhs) { return lhs.getNs() < rhs.getNs(); } - inline bool operator<=(real_timespec_timepoint const& lhs, real_timespec_timepoint const& rhs) + inline bool operator<=(real_platform_timepoint const& lhs, real_platform_timepoint const& rhs) { return lhs.getNs() <= rhs.getNs(); } - inline bool operator>(real_timespec_timepoint const& lhs, real_timespec_timepoint const& rhs) + inline bool operator>(real_platform_timepoint const& lhs, real_platform_timepoint const& rhs) { return lhs.getNs() > rhs.getNs(); } - inline bool operator>=(real_timespec_timepoint const& lhs, real_timespec_timepoint const& rhs) + inline bool operator>=(real_platform_timepoint const& lhs, real_platform_timepoint const& rhs) { return lhs.getNs() >= rhs.getNs(); } - inline real_timespec_timepoint operator+(real_timespec_timepoint const& lhs, timespec_duration const& rhs) + inline real_platform_timepoint operator+(real_platform_timepoint const& lhs, platform_duration const& rhs) { - return real_timespec_timepoint(lhs.getNs() + rhs.getNs()); + return real_platform_timepoint(lhs.getNs() + rhs.getNs()); } - inline real_timespec_timepoint operator+(timespec_duration const& lhs, real_timespec_timepoint const& rhs) + inline real_platform_timepoint operator+(platform_duration const& lhs, real_platform_timepoint const& rhs) { - return real_timespec_timepoint(lhs.getNs() + rhs.getNs()); + return real_platform_timepoint(lhs.getNs() + rhs.getNs()); } - inline timespec_duration operator-(real_timespec_timepoint const& lhs, real_timespec_timepoint const& rhs) + inline platform_duration operator-(real_platform_timepoint const& lhs, real_platform_timepoint const& rhs) { - return timespec_duration(lhs.getNs() - rhs.getNs()); + return platform_duration(lhs.getNs() - rhs.getNs()); } - struct real_timespec_clock + struct real_platform_clock { - static inline real_timespec_timepoint now() + static inline real_platform_timepoint now() { #if defined(BOOST_THREAD_PLATFORM_WIN32) boost::detail::winapi::FILETIME_ ft; boost::detail::winapi::GetSystemTimeAsFileTime(&ft); // never fails boost::intmax_t ns = ((((static_cast(ft.dwHighDateTime) << 32) | ft.dwLowDateTime) - 116444736000000000LL) * 100LL); - return real_timespec_timepoint(ns); + return real_platform_timepoint(ns); #elif defined(BOOST_THREAD_MACOS) timeval tv; ::gettimeofday(&tv, 0); timespec ts; ts.tv_sec = tv.tv_sec; ts.tv_nsec = tv.tv_usec * 1000; - return real_timespec_timepoint(ts); + return real_platform_timepoint(ts); #else timespec ts; if ( ::clock_gettime( CLOCK_REALTIME, &ts ) ) { BOOST_ASSERT(0 && "Boost::Thread - clock_gettime(CLOCK_REALTIME) Internal Error"); - return real_timespec_timepoint(0); + return real_platform_timepoint(0); } - return real_timespec_timepoint(ts); + return real_platform_timepoint(ts); #endif } }; #if defined(BOOST_THREAD_HAS_MONO_CLOCK) - class mono_timespec_timepoint + class mono_platform_timepoint { public: #if defined BOOST_THREAD_PLATFORM_PTHREAD - explicit mono_timespec_timepoint(timespec const& v) : dur(v) {} + explicit mono_platform_timepoint(timespec const& v) : dur(v) {} inline timespec const& getTs() const { return dur.getTs(); } #endif - explicit mono_timespec_timepoint(boost::intmax_t const& ns) : dur(ns) {} + explicit mono_platform_timepoint(boost::intmax_t const& ns) : dur(ns) {} inline boost::intmax_t getNs() const { return dur.getNs(); } #if defined BOOST_THREAD_USES_CHRONO - // This conversion assumes that chrono::steady_clock::time_point and mono_timespec_timepoint share the same epoch. + // This conversion assumes that chrono::steady_clock::time_point and mono_platform_timepoint share the same epoch. template - mono_timespec_timepoint(chrono::time_point const& abs_time) + mono_platform_timepoint(chrono::time_point const& abs_time) : dur(abs_time.time_since_epoch()) {} #endif // can't name this max() since that is a macro on some Windows systems - static inline mono_timespec_timepoint getMax() + static inline mono_platform_timepoint getMax() { #if defined BOOST_THREAD_PLATFORM_PTHREAD timespec ts; ts.tv_sec = (std::numeric_limits::max)(); ts.tv_nsec = 999999999; - return mono_timespec_timepoint(ts); + return mono_platform_timepoint(ts); #else boost::intmax_t ns = (std::numeric_limits::max)(); - return mono_timespec_timepoint(ns); + return mono_platform_timepoint(ns); #endif } private: - timespec_duration dur; + platform_duration dur; }; - inline bool operator==(mono_timespec_timepoint const& lhs, mono_timespec_timepoint const& rhs) + inline bool operator==(mono_platform_timepoint const& lhs, mono_platform_timepoint const& rhs) { return lhs.getNs() == rhs.getNs(); } - inline bool operator!=(mono_timespec_timepoint const& lhs, mono_timespec_timepoint const& rhs) + inline bool operator!=(mono_platform_timepoint const& lhs, mono_platform_timepoint const& rhs) { return lhs.getNs() != rhs.getNs(); } - inline bool operator<(mono_timespec_timepoint const& lhs, mono_timespec_timepoint const& rhs) + inline bool operator<(mono_platform_timepoint const& lhs, mono_platform_timepoint const& rhs) { return lhs.getNs() < rhs.getNs(); } - inline bool operator<=(mono_timespec_timepoint const& lhs, mono_timespec_timepoint const& rhs) + inline bool operator<=(mono_platform_timepoint const& lhs, mono_platform_timepoint const& rhs) { return lhs.getNs() <= rhs.getNs(); } - inline bool operator>(mono_timespec_timepoint const& lhs, mono_timespec_timepoint const& rhs) + inline bool operator>(mono_platform_timepoint const& lhs, mono_platform_timepoint const& rhs) { return lhs.getNs() > rhs.getNs(); } - inline bool operator>=(mono_timespec_timepoint const& lhs, mono_timespec_timepoint const& rhs) + inline bool operator>=(mono_platform_timepoint const& lhs, mono_platform_timepoint const& rhs) { return lhs.getNs() >= rhs.getNs(); } - inline mono_timespec_timepoint operator+(mono_timespec_timepoint const& lhs, timespec_duration const& rhs) + inline mono_platform_timepoint operator+(mono_platform_timepoint const& lhs, platform_duration const& rhs) { - return mono_timespec_timepoint(lhs.getNs() + rhs.getNs()); + return mono_platform_timepoint(lhs.getNs() + rhs.getNs()); } - inline mono_timespec_timepoint operator+(timespec_duration const& lhs, mono_timespec_timepoint const& rhs) + inline mono_platform_timepoint operator+(platform_duration const& lhs, mono_platform_timepoint const& rhs) { - return mono_timespec_timepoint(lhs.getNs() + rhs.getNs()); + return mono_platform_timepoint(lhs.getNs() + rhs.getNs()); } - inline timespec_duration operator-(mono_timespec_timepoint const& lhs, mono_timespec_timepoint const& rhs) + inline platform_duration operator-(mono_platform_timepoint const& lhs, mono_platform_timepoint const& rhs) { - return timespec_duration(lhs.getNs() - rhs.getNs()); + return platform_duration(lhs.getNs() - rhs.getNs()); } - struct mono_timespec_clock + struct mono_platform_clock { - static inline mono_timespec_timepoint now() + static inline mono_platform_timepoint now() { #if defined(BOOST_THREAD_PLATFORM_WIN32) #if defined(BOOST_THREAD_USES_CHRONO) @@ -333,12 +333,12 @@ namespace boost if ( !boost::detail::winapi::QueryPerformanceFrequency( &freq ) ) { BOOST_ASSERT(0 && "Boost::Thread - QueryPerformanceFrequency Internal Error"); - return mono_timespec_timepoint(0); + return mono_platform_timepoint(0); } if ( freq.QuadPart <= 0 ) { BOOST_ASSERT(0 && "Boost::Thread - QueryPerformanceFrequency Internal Error"); - return mono_timespec_timepoint(0); + return mono_platform_timepoint(0); } boost::detail::winapi::LARGE_INTEGER_ pcount; @@ -348,31 +348,31 @@ namespace boost if ( ++times > 3 ) { BOOST_ASSERT(0 && "Boost::Thread - QueryPerformanceCounter Internal Error"); - return mono_timespec_timepoint(0); + return mono_platform_timepoint(0); } } long double ns = 1000000000.0L * pcount.QuadPart / freq.QuadPart; - return mono_timespec_timepoint(static_cast(ns)); + return mono_platform_timepoint(static_cast(ns)); #else // Use GetTickCount64() because it's more reliable on older // systems like Windows XP and Windows Server 2003. win32::ticks_type msec = win32::GetTickCount64_()(); - return mono_timespec_timepoint(msec * 1000000); + return mono_platform_timepoint(msec * 1000000); #endif #elif defined(BOOST_THREAD_MACOS) - // fixme: add support for mono_timespec_clock::now() on MAC OS X using code from + // fixme: add support for mono_platform_clock::now() on MAC OS X using code from // https://github.com/boostorg/chrono/blob/develop/include/boost/chrono/detail/inlined/mac/chrono.hpp // Also update BOOST_THREAD_HAS_MONO_CLOCK in config.hpp - return mono_timespec_timepoint(0); + return mono_platform_timepoint(0); #else timespec ts; if ( ::clock_gettime( CLOCK_MONOTONIC, &ts ) ) { BOOST_ASSERT(0 && "Boost::Thread - clock_gettime(CLOCK_MONOTONIC) Internal Error"); - return mono_timespec_timepoint(0); + return mono_platform_timepoint(0); } - return mono_timespec_timepoint(ts); + return mono_platform_timepoint(ts); #endif } }; @@ -380,11 +380,11 @@ namespace boost #endif #if defined(BOOST_THREAD_INTERNAL_CLOCK_IS_MONO) - typedef mono_timespec_clock internal_timespec_clock; - typedef mono_timespec_timepoint internal_timespec_timepoint; + typedef mono_platform_clock internal_platform_clock; + typedef mono_platform_timepoint internal_platform_timepoint; #else - typedef real_timespec_clock internal_timespec_clock; - typedef real_timespec_timepoint internal_timespec_timepoint; + typedef real_platform_clock internal_platform_clock; + typedef real_platform_timepoint internal_platform_timepoint; #endif #ifdef BOOST_THREAD_USES_CHRONO diff --git a/include/boost/thread/detail/thread.hpp b/include/boost/thread/detail/thread.hpp index 20329398..5ce56332 100644 --- a/include/boost/thread/detail/thread.hpp +++ b/include/boost/thread/detail/thread.hpp @@ -490,21 +490,21 @@ namespace boost } #endif private: - bool do_try_join_until_noexcept(detail::internal_timespec_timepoint const &timeout, bool& res); - inline bool do_try_join_until(detail::internal_timespec_timepoint const &timeout); + bool do_try_join_until_noexcept(detail::internal_platform_timepoint const &timeout, bool& res); + inline bool do_try_join_until(detail::internal_platform_timepoint const &timeout); public: #if defined BOOST_THREAD_USES_DATETIME bool timed_join(const system_time& abs_time) { - const detail::real_timespec_timepoint ts(abs_time); + const detail::real_platform_timepoint ts(abs_time); #if defined BOOST_THREAD_INTERNAL_CLOCK_IS_MONO - detail::timespec_duration d = ts - detail::real_timespec_clock::now(); - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_try_join_until(detail::internal_timespec_clock::now() + d) ) + detail::platform_duration d = ts - detail::real_platform_clock::now(); + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_try_join_until(detail::internal_platform_clock::now() + d) ) { - d = ts - detail::real_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::real_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else @@ -516,7 +516,7 @@ namespace boost template bool try_join_until(const chrono::time_point& t) { - return do_try_join_until(boost::detail::internal_timespec_timepoint(t)); + return do_try_join_until(boost::detail::internal_platform_timepoint(t)); } #endif public: @@ -525,19 +525,19 @@ namespace boost template inline bool timed_join(TimeDuration const& rel_time) { - detail::timespec_duration d(rel_time); + detail::platform_duration d(rel_time); #if defined(BOOST_THREAD_HAS_MONO_CLOCK) && !defined(BOOST_THREAD_INTERNAL_CLOCK_IS_MONO) - const detail::mono_timespec_timepoint& ts = detail::mono_timespec_clock::now() + d; - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_try_join_until(detail::internal_timespec_clock::now() + d) ) + const detail::mono_platform_timepoint& ts = detail::mono_platform_clock::now() + d; + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_try_join_until(detail::internal_platform_clock::now() + d) ) { - d = ts - detail::mono_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::mono_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else - return do_try_join_until(detail::internal_timespec_clock::now() + d); + return do_try_join_until(detail::internal_platform_clock::now() + d); #endif } #endif @@ -755,7 +755,7 @@ namespace boost ); } - bool thread::do_try_join_until(detail::internal_timespec_timepoint const &timeout) + bool thread::do_try_join_until(detail::internal_platform_timepoint const &timeout) { if (this_thread::get_id() == get_id()) boost::throw_exception(thread_resource_error(static_cast(system::errc::resource_deadlock_would_occur), "boost thread: trying joining itself")); diff --git a/include/boost/thread/future.hpp b/include/boost/thread/future.hpp index 448fec95..aa1694f4 100644 --- a/include/boost/thread/future.hpp +++ b/include/boost/thread/future.hpp @@ -38,7 +38,7 @@ #include #include -#include +#include #if defined BOOST_THREAD_FUTURE_USES_OPTIONAL #include @@ -371,7 +371,7 @@ namespace boost wait(lock, rethrow); } - bool do_wait_until(detail::internal_timespec_timepoint const &abs_time) + bool do_wait_until(detail::internal_platform_timepoint const &abs_time) { boost::unique_lock lock(this->mutex); if (is_deferred_) @@ -1468,7 +1468,7 @@ namespace boost return future_->unnotify_when_ready(h); } - bool do_wait_until(detail::internal_timespec_timepoint const &abs_time) const + bool do_wait_until(detail::internal_platform_timepoint const &abs_time) const { if(!future_) { @@ -1481,19 +1481,19 @@ namespace boost template bool timed_wait(Duration const& rel_time) const { - detail::timespec_duration d(rel_time); + detail::platform_duration d(rel_time); #if defined(BOOST_THREAD_HAS_MONO_CLOCK) && !defined(BOOST_THREAD_INTERNAL_CLOCK_IS_MONO) - const detail::mono_timespec_timepoint& ts = detail::mono_timespec_clock::now() + d; - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_wait_until(detail::internal_timespec_clock::now() + d) ) + const detail::mono_platform_timepoint& ts = detail::mono_platform_clock::now() + d; + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_wait_until(detail::internal_platform_clock::now() + d) ) { - d = ts - detail::mono_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::mono_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else - return do_wait_until(detail::internal_timespec_clock::now() + d); + return do_wait_until(detail::internal_platform_clock::now() + d); #endif } diff --git a/include/boost/thread/pthread/condition_variable.hpp b/include/boost/thread/pthread/condition_variable.hpp index 7c641d30..f54e31ae 100644 --- a/include/boost/thread/pthread/condition_variable.hpp +++ b/include/boost/thread/pthread/condition_variable.hpp @@ -6,7 +6,7 @@ // (C) Copyright 2007-10 Anthony Williams // (C) Copyright 2011-2012 Vicente J. Botet Escriba -#include +#include #include #include @@ -101,7 +101,7 @@ namespace boost inline bool condition_variable::do_wait_until( unique_lock& m, - detail::internal_timespec_timepoint const &timeout) + detail::internal_platform_timepoint const &timeout) { #if defined BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED if (!m.owns_lock()) @@ -222,18 +222,18 @@ namespace boost boost::system_time const& abs_time_fixed = abs_time; #endif #if defined BOOST_THREAD_INTERNAL_CLOCK_IS_MONO - const detail::real_timespec_timepoint ts(abs_time_fixed); - detail::timespec_duration d = ts - detail::real_timespec_clock::now(); - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_wait_until(m, detail::internal_timespec_clock::now() + d) ) + const detail::real_platform_timepoint ts(abs_time_fixed); + detail::platform_duration d = ts - detail::real_platform_clock::now(); + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_wait_until(m, detail::internal_platform_clock::now() + d) ) { - d = ts - detail::real_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::real_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else - return do_wait_until(m, detail::internal_timespec_timepoint(abs_time_fixed)); + return do_wait_until(m, detail::internal_platform_timepoint(abs_time_fixed)); #endif } template @@ -254,19 +254,19 @@ namespace boost { return true; } - detail::timespec_duration d(wait_duration); + detail::platform_duration d(wait_duration); #if defined(BOOST_THREAD_HAS_MONO_CLOCK) && !defined(BOOST_THREAD_INTERNAL_CLOCK_IS_MONO) - const detail::mono_timespec_timepoint& ts = detail::mono_timespec_clock::now() + d; - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_wait_until(m, detail::internal_timespec_clock::now() + d) ) + const detail::mono_platform_timepoint& ts = detail::mono_platform_clock::now() + d; + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_wait_until(m, detail::internal_platform_clock::now() + d) ) { - d = ts - detail::mono_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::mono_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else - return do_wait_until(m, detail::internal_timespec_clock::now() + d); + return do_wait_until(m, detail::internal_platform_clock::now() + d); #endif } @@ -302,19 +302,19 @@ namespace boost { return pred(); } - detail::timespec_duration d(wait_duration); + detail::platform_duration d(wait_duration); #if defined(BOOST_THREAD_HAS_MONO_CLOCK) && !defined(BOOST_THREAD_INTERNAL_CLOCK_IS_MONO) - const detail::mono_timespec_timepoint& ts = detail::mono_timespec_clock::now() + d; - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! pred() && ! do_wait_until(m, detail::internal_timespec_clock::now() + d) ) + const detail::mono_platform_timepoint& ts = detail::mono_platform_clock::now() + d; + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! pred() && ! do_wait_until(m, detail::internal_platform_clock::now() + d) ) { - d = ts - detail::mono_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return pred(); - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::mono_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return pred(); + d = (std::min)(d, detail::platform_milliseconds(100)); } return pred(); #else - return do_wait_until(m, detail::internal_timespec_clock::now() + d, move(pred)); + return do_wait_until(m, detail::internal_platform_clock::now() + d, move(pred)); #endif } #endif @@ -326,7 +326,7 @@ namespace boost lock_type& lock, const chrono::time_point& t) { - const boost::detail::internal_timespec_timepoint ts(t); + const boost::detail::internal_platform_timepoint ts(t); if (do_wait_until(lock, ts)) return cv_status::no_timeout; else return cv_status::timeout; } @@ -400,7 +400,7 @@ namespace boost template bool do_wait_until( lock_type& m, - detail::internal_timespec_timepoint const &timeout) + detail::internal_platform_timepoint const &timeout) { int res=0; { @@ -431,7 +431,7 @@ namespace boost template bool do_wait_until( lock_type& lock, - detail::internal_timespec_timepoint const& t, + detail::internal_platform_timepoint const& t, Predicate pred) { while (!pred()) diff --git a/include/boost/thread/pthread/condition_variable_fwd.hpp b/include/boost/thread/pthread/condition_variable_fwd.hpp index ee644b4d..4ac94165 100644 --- a/include/boost/thread/pthread/condition_variable_fwd.hpp +++ b/include/boost/thread/pthread/condition_variable_fwd.hpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #if defined BOOST_THREAD_USES_DATETIME @@ -46,11 +46,11 @@ namespace boost inline bool do_wait_until( unique_lock& lock, - detail::internal_timespec_timepoint const &timeout); + detail::internal_platform_timepoint const &timeout); template bool do_wait_until( unique_lock& lock, - detail::internal_timespec_timepoint const &timeout, + detail::internal_platform_timepoint const &timeout, Predicate pred) { while (!pred()) @@ -122,18 +122,18 @@ namespace boost boost::system_time const& abs_time_fixed = abs_time; #endif #if defined BOOST_THREAD_INTERNAL_CLOCK_IS_MONO - const detail::real_timespec_timepoint ts(abs_time_fixed); - detail::timespec_duration d = ts - detail::real_timespec_clock::now(); - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_wait_until(m, detail::internal_timespec_clock::now() + d) ) + const detail::real_platform_timepoint ts(abs_time_fixed); + detail::platform_duration d = ts - detail::real_platform_clock::now(); + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_wait_until(m, detail::internal_platform_clock::now() + d) ) { - d = ts - detail::real_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::real_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else - return do_wait_until(m, detail::internal_timespec_timepoint(abs_time_fixed)); + return do_wait_until(m, detail::internal_platform_timepoint(abs_time_fixed)); #endif } bool timed_wait( @@ -157,19 +157,19 @@ namespace boost { return true; } - detail::timespec_duration d(wait_duration); + detail::platform_duration d(wait_duration); #if defined(BOOST_THREAD_HAS_MONO_CLOCK) && !defined(BOOST_THREAD_INTERNAL_CLOCK_IS_MONO) - const detail::mono_timespec_timepoint& ts = detail::mono_timespec_clock::now() + d; - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_wait_until(m, detail::internal_timespec_clock::now() + d) ) + const detail::mono_platform_timepoint& ts = detail::mono_platform_clock::now() + d; + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_wait_until(m, detail::internal_platform_clock::now() + d) ) { - d = ts - detail::mono_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::mono_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else - return do_wait_until(m, detail::internal_timespec_clock::now() + d); + return do_wait_until(m, detail::internal_platform_clock::now() + d); #endif } @@ -211,19 +211,19 @@ namespace boost { return pred(); } - detail::timespec_duration d(wait_duration); + detail::platform_duration d(wait_duration); #if defined(BOOST_THREAD_HAS_MONO_CLOCK) && !defined(BOOST_THREAD_INTERNAL_CLOCK_IS_MONO) - const detail::mono_timespec_timepoint& ts = detail::mono_timespec_clock::now() + d; - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! pred() && ! do_wait_until(m, detail::internal_timespec_clock::now() + d) ) + const detail::mono_platform_timepoint& ts = detail::mono_platform_clock::now() + d; + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! pred() && ! do_wait_until(m, detail::internal_platform_clock::now() + d) ) { - d = ts - detail::mono_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return pred(); - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::mono_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return pred(); + d = (std::min)(d, detail::platform_milliseconds(100)); } return pred(); #else - return do_wait_until(m, detail::internal_timespec_clock::now() + d, move(pred)); + return do_wait_until(m, detail::internal_platform_clock::now() + d, move(pred)); #endif } #endif @@ -236,7 +236,7 @@ namespace boost unique_lock& lock, const chrono::time_point& t) { - const detail::internal_timespec_timepoint ts(t); + const detail::internal_platform_timepoint ts(t); if (do_wait_until(lock, ts)) return cv_status::no_timeout; else return cv_status::timeout; } diff --git a/include/boost/thread/pthread/mutex.hpp b/include/boost/thread/pthread/mutex.hpp index 8f1e9182..70ce1125 100644 --- a/include/boost/thread/pthread/mutex.hpp +++ b/include/boost/thread/pthread/mutex.hpp @@ -21,7 +21,7 @@ #endif #include #include -#include +#include #include #include #ifdef BOOST_THREAD_USES_CHRONO @@ -205,19 +205,19 @@ namespace boost { return true; } - detail::timespec_duration d(relative_time); + detail::platform_duration d(relative_time); #if defined(BOOST_THREAD_HAS_MONO_CLOCK) && !defined(BOOST_THREAD_INTERNAL_CLOCK_IS_MONO) - const detail::mono_timespec_timepoint& ts = detail::mono_timespec_clock::now() + d; - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_try_lock_until(detail::internal_timespec_clock::now() + d) ) + const detail::mono_platform_timepoint& ts = detail::mono_platform_clock::now() + d; + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_try_lock_until(detail::internal_platform_clock::now() + d) ) { - d = ts - detail::mono_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::mono_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else - return do_try_lock_until(detail::internal_timespec_clock::now() + d); + return do_try_lock_until(detail::internal_platform_clock::now() + d); #endif } bool timed_lock(boost::xtime const & absolute_time) @@ -264,7 +264,7 @@ namespace boost private: // fixme: Shouldn't this functions be located on a .cpp file? - bool do_try_lock_until(detail::internal_timespec_timepoint const &timeout) + bool do_try_lock_until(detail::internal_platform_timepoint const &timeout) { int const res=pthread_mutex_timedlock(&m,&timeout.getTs()); BOOST_ASSERT(!res || res==ETIMEDOUT); @@ -303,7 +303,7 @@ namespace boost private: // fixme: Shouldn't this functions be located on a .cpp file? - bool do_try_lock_until(detail::internal_timespec_timepoint const &timeout) + bool do_try_lock_until(detail::internal_platform_timepoint const &timeout) { boost::pthread::pthread_mutex_scoped_lock const local_lock(&m); while(is_locked) @@ -324,15 +324,15 @@ namespace boost #if defined BOOST_THREAD_USES_DATETIME bool timed_lock(system_time const & abs_time) { - const detail::real_timespec_timepoint ts(abs_time); + const detail::real_platform_timepoint ts(abs_time); #if defined BOOST_THREAD_INTERNAL_CLOCK_IS_MONO - detail::timespec_duration d = ts - detail::real_timespec_clock::now(); - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_try_lock_until(detail::internal_timespec_clock::now() + d) ) + detail::platform_duration d = ts - detail::real_platform_clock::now(); + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_try_lock_until(detail::internal_platform_clock::now() + d) ) { - d = ts - detail::real_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::real_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else @@ -363,7 +363,7 @@ namespace boost template bool try_lock_until(const chrono::time_point& t) { - detail::internal_timespec_timepoint ts(t); + detail::internal_platform_timepoint ts(t); return do_try_lock_until(ts); } #endif diff --git a/include/boost/thread/pthread/recursive_mutex.hpp b/include/boost/thread/pthread/recursive_mutex.hpp index 6a179e26..b33d3b8c 100644 --- a/include/boost/thread/pthread/recursive_mutex.hpp +++ b/include/boost/thread/pthread/recursive_mutex.hpp @@ -19,7 +19,7 @@ #endif #include #include -#include +#include #include #include #ifdef BOOST_THREAD_USES_CHRONO @@ -250,19 +250,19 @@ namespace boost { return true; } - detail::timespec_duration d(relative_time); + detail::platform_duration d(relative_time); #if defined(BOOST_THREAD_HAS_MONO_CLOCK) && !defined(BOOST_THREAD_INTERNAL_CLOCK_IS_MONO) - const detail::mono_timespec_timepoint& ts = detail::mono_timespec_clock::now() + d; - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_try_lock_until(detail::internal_timespec_clock::now() + d) ) + const detail::mono_platform_timepoint& ts = detail::mono_platform_clock::now() + d; + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_try_lock_until(detail::internal_platform_clock::now() + d) ) { - d = ts - detail::mono_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::mono_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else - return do_try_lock_until(detail::internal_timespec_clock::now() + d); + return do_try_lock_until(detail::internal_platform_clock::now() + d); #endif } #endif @@ -286,7 +286,7 @@ namespace boost } private: // fixme: Shouldn't this functions be located on a .cpp file? - bool do_try_lock_until(detail::internal_timespec_timepoint const &timeout) + bool do_try_lock_until(detail::internal_platform_timepoint const &timeout) { int const res=pthread_mutex_timedlock(&m,&timeout.getTs()); BOOST_ASSERT(!res || res==ETIMEDOUT); @@ -339,7 +339,7 @@ namespace boost private: // fixme: Shouldn't this functions be located on a .cpp file? - bool do_try_lock_until(detail::internal_timespec_timepoint const &timeout) + bool do_try_lock_until(detail::internal_platform_timepoint const &timeout) { boost::pthread::pthread_mutex_scoped_lock const local_lock(&m); if(is_locked && pthread_equal(owner,pthread_self())) @@ -368,15 +368,15 @@ namespace boost #if defined BOOST_THREAD_USES_DATETIME bool timed_lock(system_time const & abs_time) { - const detail::real_timespec_timepoint ts(abs_time); + const detail::real_platform_timepoint ts(abs_time); #if defined BOOST_THREAD_INTERNAL_CLOCK_IS_MONO - detail::timespec_duration d = ts - detail::real_timespec_clock::now(); - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_try_lock_until(detail::internal_timespec_clock::now() + d) ) + detail::platform_duration d = ts - detail::real_platform_clock::now(); + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_try_lock_until(detail::internal_platform_clock::now() + d) ) { - d = ts - detail::real_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::real_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else @@ -408,7 +408,7 @@ namespace boost template bool try_lock_until(const chrono::time_point& t) { - detail::internal_timespec_timepoint ts(t); + detail::internal_platform_timepoint ts(t); return do_try_lock_until(ts); } #endif diff --git a/include/boost/thread/pthread/shared_mutex.hpp b/include/boost/thread/pthread/shared_mutex.hpp index 1b056912..344de72d 100644 --- a/include/boost/thread/pthread/shared_mutex.hpp +++ b/include/boost/thread/pthread/shared_mutex.hpp @@ -20,7 +20,7 @@ #include #endif #include -#include +#include #include @@ -208,15 +208,15 @@ namespace boost #if defined BOOST_THREAD_USES_DATETIME bool timed_lock_shared(system_time const& timeout) { - const detail::real_timespec_timepoint ts(timeout); + const detail::real_platform_timepoint ts(timeout); #if defined BOOST_THREAD_INTERNAL_CLOCK_IS_MONO - detail::timespec_duration d = ts - detail::real_timespec_clock::now(); - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_try_lock_shared_until(detail::internal_timespec_clock::now() + d) ) + detail::platform_duration d = ts - detail::real_platform_clock::now(); + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_try_lock_shared_until(detail::internal_platform_clock::now() + d) ) { - d = ts - detail::real_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::real_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else @@ -236,19 +236,19 @@ namespace boost { return true; } - detail::timespec_duration d(relative_time); + detail::platform_duration d(relative_time); #if defined(BOOST_THREAD_HAS_MONO_CLOCK) && !defined(BOOST_THREAD_INTERNAL_CLOCK_IS_MONO) - const detail::mono_timespec_timepoint& ts = detail::mono_timespec_clock::now() + d; - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_try_lock_shared_until(detail::internal_timespec_clock::now() + d) ) + const detail::mono_platform_timepoint& ts = detail::mono_platform_clock::now() + d; + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_try_lock_shared_until(detail::internal_platform_clock::now() + d) ) { - d = ts - detail::mono_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::mono_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else - return do_try_lock_shared_until(detail::internal_timespec_clock::now() + d); + return do_try_lock_shared_until(detail::internal_platform_clock::now() + d); #endif } #endif @@ -261,7 +261,7 @@ namespace boost template bool try_lock_shared_until(const chrono::time_point& t) { - return do_try_lock_shared_until(boost::detail::internal_timespec_timepoint(t)); + return do_try_lock_shared_until(boost::detail::internal_platform_timepoint(t)); } template bool try_lock_shared_until(const chrono::time_point& t) @@ -320,7 +320,7 @@ namespace boost private: // fixme: Shouldn't these functions be located on a .cpp file? - bool do_try_lock_until(const detail::internal_timespec_timepoint& abs_time) + bool do_try_lock_until(const detail::internal_platform_timepoint& abs_time) { #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS boost::this_thread::disable_interruption do_not_disturb; @@ -344,7 +344,7 @@ namespace boost state.exclusive=true; return true; } - bool do_try_lock_shared_until(const detail::internal_timespec_timepoint& abs_time) + bool do_try_lock_shared_until(const detail::internal_platform_timepoint& abs_time) { #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS boost::this_thread::disable_interruption do_not_disturb; @@ -362,7 +362,7 @@ namespace boost state.lock_shared(); return true; } - bool do_try_lock_upgrade_until(const detail::internal_timespec_timepoint& abs_time) + bool do_try_lock_upgrade_until(const detail::internal_platform_timepoint& abs_time) { #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS boost::this_thread::disable_interruption do_not_disturb; @@ -384,7 +384,7 @@ namespace boost return true; } bool do_try_unlock_upgrade_and_lock_until( - const detail::internal_timespec_timepoint& abs_time) + const detail::internal_platform_timepoint& abs_time) { #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS boost::this_thread::disable_interruption do_not_disturb; @@ -414,15 +414,15 @@ namespace boost #if defined BOOST_THREAD_USES_DATETIME bool timed_lock(system_time const& timeout) { - const detail::real_timespec_timepoint ts(timeout); + const detail::real_platform_timepoint ts(timeout); #if defined BOOST_THREAD_INTERNAL_CLOCK_IS_MONO - detail::timespec_duration d = ts - detail::real_timespec_clock::now(); - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_try_lock_until(detail::internal_timespec_clock::now() + d) ) + detail::platform_duration d = ts - detail::real_platform_clock::now(); + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_try_lock_until(detail::internal_platform_clock::now() + d) ) { - d = ts - detail::real_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::real_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else @@ -442,19 +442,19 @@ namespace boost { return true; } - detail::timespec_duration d(relative_time); + detail::platform_duration d(relative_time); #if defined(BOOST_THREAD_HAS_MONO_CLOCK) && !defined(BOOST_THREAD_INTERNAL_CLOCK_IS_MONO) - const detail::mono_timespec_timepoint& ts = detail::mono_timespec_clock::now() + d; - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_try_lock_until(detail::internal_timespec_clock::now() + d) ) + const detail::mono_platform_timepoint& ts = detail::mono_platform_clock::now() + d; + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_try_lock_until(detail::internal_platform_clock::now() + d) ) { - d = ts - detail::mono_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::mono_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else - return do_try_lock_until(detail::internal_timespec_clock::now() + d); + return do_try_lock_until(detail::internal_platform_clock::now() + d); #endif } #endif @@ -467,7 +467,7 @@ namespace boost template bool try_lock_until(const chrono::time_point& t) { - return do_try_lock_until(boost::detail::internal_timespec_timepoint(t)); + return do_try_lock_until(boost::detail::internal_platform_timepoint(t)); } template bool try_lock_until(const chrono::time_point& t) @@ -528,15 +528,15 @@ namespace boost #if defined BOOST_THREAD_USES_DATETIME bool timed_lock_upgrade(system_time const& timeout) { - const detail::real_timespec_timepoint ts(timeout); + const detail::real_platform_timepoint ts(timeout); #if defined BOOST_THREAD_INTERNAL_CLOCK_IS_MONO - detail::timespec_duration d = ts - detail::real_timespec_clock::now(); - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_try_lock_upgrade_until(detail::internal_timespec_clock::now() + d) ) + detail::platform_duration d = ts - detail::real_platform_clock::now(); + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_try_lock_upgrade_until(detail::internal_platform_clock::now() + d) ) { - d = ts - detail::real_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::real_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else @@ -556,19 +556,19 @@ namespace boost { return true; } - detail::timespec_duration d(relative_time); + detail::platform_duration d(relative_time); #if defined(BOOST_THREAD_HAS_MONO_CLOCK) && !defined(BOOST_THREAD_INTERNAL_CLOCK_IS_MONO) - const detail::mono_timespec_timepoint& ts = detail::mono_timespec_clock::now() + d; - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_try_lock_upgrade_until(detail::internal_timespec_clock::now() + d) ) + const detail::mono_platform_timepoint& ts = detail::mono_platform_clock::now() + d; + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_try_lock_upgrade_until(detail::internal_platform_clock::now() + d) ) { - d = ts - detail::mono_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::mono_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #else - return do_try_lock_upgrade_until(detail::internal_timespec_clock::now() + d); + return do_try_lock_upgrade_until(detail::internal_platform_clock::now() + d); #endif } #endif @@ -581,7 +581,7 @@ namespace boost template bool try_lock_upgrade_until(const chrono::time_point& t) { - return do_try_lock_upgrade_until(boost::detail::internal_timespec_timepoint(t)); + return do_try_lock_upgrade_until(boost::detail::internal_platform_timepoint(t)); } template bool try_lock_upgrade_until(const chrono::time_point& t) @@ -686,7 +686,7 @@ namespace boost template bool try_unlock_upgrade_and_lock_until(const chrono::time_point& t) { - return do_try_unlock_upgrade_and_lock_until(boost::detail::internal_timespec_timepoint(t)); + return do_try_unlock_upgrade_and_lock_until(boost::detail::internal_platform_timepoint(t)); } template bool try_unlock_upgrade_and_lock_until(const chrono::time_point& t) diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread/pthread/thread_data.hpp index 5ab49bba..10e06ce7 100644 --- a/include/boost/thread/pthread/thread_data.hpp +++ b/include/boost/thread/pthread/thread_data.hpp @@ -241,14 +241,14 @@ namespace boost { namespace hidden { - void BOOST_THREAD_DECL sleep_for(const detail::timespec_duration& ts); + void BOOST_THREAD_DECL sleep_for(const detail::platform_duration& ts); } namespace no_interruption_point { namespace hidden { - void BOOST_THREAD_DECL sleep_for(const detail::timespec_duration& ts); + void BOOST_THREAD_DECL sleep_for(const detail::platform_duration& ts); } #ifdef BOOST_THREAD_USES_CHRONO @@ -256,7 +256,7 @@ namespace boost template void sleep_for(const chrono::duration& d) { - return boost::this_thread::no_interruption_point::hidden::sleep_for(detail::timespec_duration(d)); + return boost::this_thread::no_interruption_point::hidden::sleep_for(detail::platform_duration(d)); } #endif #endif // BOOST_THREAD_USES_CHRONO @@ -272,18 +272,18 @@ namespace boost #endif inline void sleep(system_time const& abs_time) { - const detail::real_timespec_timepoint ts(abs_time); + const detail::real_platform_timepoint ts(abs_time); mutex mx; unique_lock lock(mx); condition_variable cond; #if defined BOOST_THREAD_INTERNAL_CLOCK_IS_MONO - detail::timespec_duration d = ts - detail::real_timespec_clock::now(); - while (d > detail::timespec_duration::zero()) + detail::platform_duration d = ts - detail::real_platform_clock::now(); + while (d > detail::platform_duration::zero()) { - d = (std::min)(d, detail::timespec_milliseconds(100)); - cond.do_wait_until(lock, detail::internal_timespec_clock::now() + d); - d = ts - detail::real_timespec_clock::now(); + d = (std::min)(d, detail::platform_milliseconds(100)); + cond.do_wait_until(lock, detail::internal_platform_clock::now() + d); + d = ts - detail::real_platform_clock::now(); } #else while (cond.do_wait_until(lock, ts)) {} @@ -293,7 +293,7 @@ namespace boost template void sleep(TimeDuration const& rel_time) { - boost::this_thread::hidden::sleep_for(detail::timespec_duration(rel_time)); + boost::this_thread::hidden::sleep_for(detail::platform_duration(rel_time)); } #endif // BOOST_THREAD_USES_DATETIME } // this_thread diff --git a/include/boost/thread/v2/shared_mutex.hpp b/include/boost/thread/v2/shared_mutex.hpp index 1a4bdd6a..6f4574a1 100644 --- a/include/boost/thread/v2/shared_mutex.hpp +++ b/include/boost/thread/v2/shared_mutex.hpp @@ -226,14 +226,14 @@ namespace boost { template bool timed_lock(TimeDuration const & relative_time) { - // fixme: make use of internal_timespec_clock here + // fixme: make use of internal_platform_clock here return timed_lock(get_system_time()+relative_time); } bool timed_lock_shared(system_time const& timeout); template bool timed_lock_shared(TimeDuration const & relative_time) { - // fixme: make use of internal_timespec_clock here + // fixme: make use of internal_platform_clock here return timed_lock_shared(get_system_time()+relative_time); } #endif @@ -494,21 +494,21 @@ namespace boost { template bool timed_lock(TimeDuration const & relative_time) { - // fixme: make use of internal_timespec_clock here + // fixme: make use of internal_platform_clock here return timed_lock(get_system_time()+relative_time); } inline bool timed_lock_shared(system_time const& abs_time); template bool timed_lock_shared(TimeDuration const & relative_time) { - // fixme: make use of internal_timespec_clock here + // fixme: make use of internal_platform_clock here return timed_lock_shared(get_system_time()+relative_time); } inline bool timed_lock_upgrade(system_time const& abs_time); template bool timed_lock_upgrade(TimeDuration const & relative_time) { - // fixme: make use of internal_timespec_clock here + // fixme: make use of internal_platform_clock here return timed_lock_upgrade(get_system_time()+relative_time); } #endif diff --git a/include/boost/thread/win32/condition_variable.hpp b/include/boost/thread/win32/condition_variable.hpp index de48ca8c..bcb9e23a 100644 --- a/include/boost/thread/win32/condition_variable.hpp +++ b/include/boost/thread/win32/condition_variable.hpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include @@ -90,7 +90,7 @@ namespace boost return notified; } - bool do_wait_until(detail::internal_timespec_timepoint const &timeout) + bool do_wait_until(detail::internal_platform_timepoint const &timeout) { return this_thread::interruptible_wait(semaphore, timeout); } @@ -244,7 +244,7 @@ namespace boost {} template - bool do_wait_until(lock_type& lock, detail::internal_timespec_timepoint const &timeout) + bool do_wait_until(lock_type& lock, detail::internal_platform_timepoint const &timeout) { relocker locker(lock); entry_manager entry(get_wait_entry(), internal_mutex); @@ -325,7 +325,7 @@ namespace boost void wait(unique_lock& m) { - do_wait_until(m, detail::internal_timespec_timepoint::getMax()); + do_wait_until(m, detail::internal_platform_timepoint::getMax()); } template @@ -339,18 +339,18 @@ namespace boost bool timed_wait(unique_lock& m,boost::system_time const& abs_time) { #if 1 - const detail::real_timespec_timepoint ts(abs_time); - detail::timespec_duration d = ts - detail::real_timespec_clock::now(); - return do_wait_until(m, detail::internal_timespec_clock::now() + d); + const detail::real_platform_timepoint ts(abs_time); + detail::platform_duration d = ts - detail::real_platform_clock::now(); + return do_wait_until(m, detail::internal_platform_clock::now() + d); #else // fixme: this code allows notifications to be missed - const detail::real_timespec_timepoint ts(abs_time); - detail::timespec_duration d = ts - detail::real_timespec_clock::now(); - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_wait_until(m, detail::internal_timespec_clock::now() + d) ) + const detail::real_platform_timepoint ts(abs_time); + detail::platform_duration d = ts - detail::real_platform_clock::now(); + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_wait_until(m, detail::internal_platform_clock::now() + d) ) { - d = ts - detail::real_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::real_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #endif @@ -372,8 +372,8 @@ namespace boost { return true; } - const detail::internal_timespec_timepoint ts = detail::internal_timespec_clock::now() - + detail::timespec_duration(wait_duration); + const detail::internal_platform_timepoint ts = detail::internal_platform_clock::now() + + detail::platform_duration(wait_duration); return do_wait_until(m, ts); } @@ -407,8 +407,8 @@ namespace boost { return pred(); } - const detail::internal_timespec_timepoint ts = detail::internal_timespec_clock::now() - + detail::timespec_duration(wait_duration); + const detail::internal_platform_timepoint ts = detail::internal_platform_clock::now() + + detail::platform_duration(wait_duration); while (!pred()) { if(!do_wait_until(m, ts)) @@ -424,7 +424,7 @@ namespace boost unique_lock& lock, const chrono::time_point& t) { - const detail::internal_timespec_timepoint ts(t); + const detail::internal_platform_timepoint ts(t); if (do_wait_until(lock, ts)) return cv_status::no_timeout; else return cv_status::timeout; } @@ -503,7 +503,7 @@ namespace boost template void wait(lock_type& m) { - do_wait_until(m, detail::internal_timespec_timepoint::getMax()); + do_wait_until(m, detail::internal_platform_timepoint::getMax()); } template @@ -517,18 +517,18 @@ namespace boost bool timed_wait(lock_type& m,boost::system_time const& abs_time) { #if 1 - const detail::real_timespec_timepoint ts(abs_time); - detail::timespec_duration d = ts - detail::real_timespec_clock::now(); - return do_wait_until(m, detail::internal_timespec_clock::now() + d); + const detail::real_platform_timepoint ts(abs_time); + detail::platform_duration d = ts - detail::real_platform_clock::now(); + return do_wait_until(m, detail::internal_platform_clock::now() + d); #else // fixme: this code allows notifications to be missed - const detail::real_timespec_timepoint ts(abs_time); - detail::timespec_duration d = ts - detail::real_timespec_clock::now(); - d = (std::min)(d, detail::timespec_milliseconds(100)); - while ( ! do_wait_until(m, detail::internal_timespec_clock::now() + d) ) + const detail::real_platform_timepoint ts(abs_time); + detail::platform_duration d = ts - detail::real_platform_clock::now(); + d = (std::min)(d, detail::platform_milliseconds(100)); + while ( ! do_wait_until(m, detail::internal_platform_clock::now() + d) ) { - d = ts - detail::real_timespec_clock::now(); - if ( d <= detail::timespec_duration::zero() ) return false; - d = (std::min)(d, detail::timespec_milliseconds(100)); + d = ts - detail::real_platform_clock::now(); + if ( d <= detail::platform_duration::zero() ) return false; + d = (std::min)(d, detail::platform_milliseconds(100)); } return true; #endif @@ -552,8 +552,8 @@ namespace boost { return true; } - const detail::internal_timespec_timepoint ts = detail::internal_timespec_clock::now() - + detail::timespec_duration(wait_duration); + const detail::internal_platform_timepoint ts = detail::internal_platform_clock::now() + + detail::platform_duration(wait_duration); return do_wait_until(m, ts); } @@ -589,8 +589,8 @@ namespace boost { return pred(); } - const detail::internal_timespec_timepoint ts = detail::internal_timespec_clock::now() - + detail::timespec_duration(wait_duration); + const detail::internal_platform_timepoint ts = detail::internal_platform_clock::now() + + detail::platform_duration(wait_duration); while (!pred()) { if(!do_wait_until(m, ts)) @@ -606,7 +606,7 @@ namespace boost lock_type& lock, const chrono::time_point& t) { - const detail::internal_timespec_timepoint ts(t); + const detail::internal_platform_timepoint ts(t); if (do_wait_until(lock, ts)) return cv_status::no_timeout; else return cv_status::timeout; } diff --git a/include/boost/thread/win32/thread_data.hpp b/include/boost/thread/win32/thread_data.hpp index fdd8bae2..6c273751 100644 --- a/include/boost/thread/win32/thread_data.hpp +++ b/include/boost/thread/win32/thread_data.hpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include @@ -181,46 +181,46 @@ namespace boost { void BOOST_THREAD_DECL yield() BOOST_NOEXCEPT; - bool BOOST_THREAD_DECL interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_timespec_timepoint const &timeout); + bool BOOST_THREAD_DECL interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_platform_timepoint const &timeout); #if defined BOOST_THREAD_USES_DATETIME template inline BOOST_SYMBOL_VISIBLE void sleep(TimeDuration const& rel_time) { - interruptible_wait(detail::win32::invalid_handle_value, detail::internal_timespec_clock::now() + detail::timespec_duration(rel_time)); + interruptible_wait(detail::win32::invalid_handle_value, detail::internal_platform_clock::now() + detail::platform_duration(rel_time)); } inline BOOST_SYMBOL_VISIBLE void sleep(system_time const& abs_time) { - const detail::real_timespec_timepoint ts(abs_time); - detail::timespec_duration d = ts - detail::real_timespec_clock::now(); - while (d > detail::timespec_duration::zero()) + const detail::real_platform_timepoint ts(abs_time); + detail::platform_duration d = ts - detail::real_platform_clock::now(); + while (d > detail::platform_duration::zero()) { - d = (std::min)(d, detail::timespec_milliseconds(100)); - interruptible_wait(detail::win32::invalid_handle_value, detail::internal_timespec_clock::now() + d); - d = ts - detail::real_timespec_clock::now(); + d = (std::min)(d, detail::platform_milliseconds(100)); + interruptible_wait(detail::win32::invalid_handle_value, detail::internal_platform_clock::now() + d); + d = ts - detail::real_platform_clock::now(); } } #endif namespace no_interruption_point { - bool BOOST_THREAD_DECL non_interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_timespec_timepoint const &timeout); + bool BOOST_THREAD_DECL non_interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_platform_timepoint const &timeout); #if defined BOOST_THREAD_USES_DATETIME template inline BOOST_SYMBOL_VISIBLE void sleep(TimeDuration const& rel_time) { - non_interruptible_wait(detail::win32::invalid_handle_value, detail::internal_timespec_clock::now() + detail::timespec_duration(rel_time)); + non_interruptible_wait(detail::win32::invalid_handle_value, detail::internal_platform_clock::now() + detail::platform_duration(rel_time)); } inline BOOST_SYMBOL_VISIBLE void sleep(system_time const& abs_time) { - const detail::real_timespec_timepoint ts(abs_time); - detail::timespec_duration d = ts - detail::real_timespec_clock::now(); - while (d > detail::timespec_duration::zero()) + const detail::real_platform_timepoint ts(abs_time); + detail::platform_duration d = ts - detail::real_platform_clock::now(); + while (d > detail::platform_duration::zero()) { - d = (std::min)(d, detail::timespec_milliseconds(100)); - non_interruptible_wait(detail::win32::invalid_handle_value, detail::internal_timespec_clock::now() + d); - d = ts - detail::real_timespec_clock::now(); + d = (std::min)(d, detail::platform_milliseconds(100)); + non_interruptible_wait(detail::win32::invalid_handle_value, detail::internal_platform_clock::now() + d); + d = ts - detail::real_platform_clock::now(); } } #endif diff --git a/src/pthread/thread.cpp b/src/pthread/thread.cpp index ce6f9ab1..78b2d00e 100644 --- a/src/pthread/thread.cpp +++ b/src/pthread/thread.cpp @@ -350,7 +350,7 @@ namespace boost } } - bool thread::do_try_join_until_noexcept(detail::internal_timespec_timepoint const &timeout, bool& res) + bool thread::do_try_join_until_noexcept(detail::internal_platform_timepoint const &timeout, bool& res) { detail::thread_data_ptr const local_thread_info=(get_thread_info)(); if(local_thread_info) @@ -432,10 +432,10 @@ namespace boost { namespace hidden { - void BOOST_THREAD_DECL sleep_for(const detail::timespec_duration& ts) + void BOOST_THREAD_DECL sleep_for(const detail::platform_duration& ts) { - if (ts > detail::timespec_duration::zero()) + if (ts > detail::platform_duration::zero()) { // Use pthread_delay_np or nanosleep whenever possible here in the no_interruption_point // namespace because they do not provide an interruption point. @@ -449,7 +449,7 @@ namespace boost nanosleep(&ts.getTs(), 0); # else // Fall back to using a condition variable even though it does provide an interruption point. - const detail::internal_timespec_timepoint ts2 = detail::internal_timespec_clock::now() + ts; + const detail::internal_platform_timepoint ts2 = detail::internal_platform_clock::now() + ts; mutex mx; unique_lock lock(mx); condition_variable cond; @@ -461,23 +461,23 @@ namespace boost } namespace hidden { - void BOOST_THREAD_DECL sleep_for(const detail::timespec_duration& ts) + void BOOST_THREAD_DECL sleep_for(const detail::platform_duration& ts) { mutex mx; unique_lock lock(mx); condition_variable cond; #if defined(BOOST_THREAD_HAS_MONO_CLOCK) && !defined(BOOST_THREAD_INTERNAL_CLOCK_IS_MONO) - const detail::mono_timespec_timepoint& ts2 = detail::mono_timespec_clock::now() + ts; - detail::timespec_duration d = ts; - while (d > detail::timespec_duration::zero()) + const detail::mono_platform_timepoint& ts2 = detail::mono_platform_clock::now() + ts; + detail::platform_duration d = ts; + while (d > detail::platform_duration::zero()) { - d = (std::min)(d, detail::timespec_milliseconds(100)); - cond.do_wait_until(lock, detail::internal_timespec_clock::now() + d); - d = ts2 - detail::mono_timespec_clock::now(); + d = (std::min)(d, detail::platform_milliseconds(100)); + cond.do_wait_until(lock, detail::internal_platform_clock::now() + d); + d = ts2 - detail::mono_platform_clock::now(); } #else - const detail::internal_timespec_timepoint ts2 = detail::internal_timespec_clock::now() + ts; + const detail::internal_platform_timepoint ts2 = detail::internal_platform_clock::now() + ts; while (cond.do_wait_until(lock, ts2)) {} #endif } @@ -498,7 +498,7 @@ namespace boost // sleep(xt); // sleep_for(chrono::milliseconds(0)); # else - hidden::sleep_for(detail::timespec_duration::zero()); + hidden::sleep_for(detail::platform_duration::zero()); # endif } } diff --git a/src/win32/thread.cpp b/src/win32/thread.cpp index 4cf64c8c..84599bb1 100644 --- a/src/win32/thread.cpp +++ b/src/win32/thread.cpp @@ -439,7 +439,7 @@ namespace boost detail::thread_data_ptr local_thread_info=(get_thread_info)(); if(local_thread_info) { - this_thread::interruptible_wait(this->native_handle(), detail::internal_timespec_timepoint::getMax()); + this_thread::interruptible_wait(this->native_handle(), detail::internal_platform_timepoint::getMax()); release_handle(); return true; } @@ -449,7 +449,7 @@ namespace boost } } - bool thread::do_try_join_until_noexcept(detail::internal_timespec_timepoint const &timeout, bool& res) + bool thread::do_try_join_until_noexcept(detail::internal_platform_timepoint const &timeout, bool& res) { detail::thread_data_ptr local_thread_info=(get_thread_info)(); if(local_thread_info) @@ -605,7 +605,7 @@ namespace boost } #endif #endif - bool interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_timespec_timepoint const &timeout) + bool interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_platform_timepoint const &timeout) { detail::win32::handle handles[4]={0}; unsigned handle_count=0; @@ -631,9 +631,9 @@ namespace boost #ifndef UNDER_CE #if !BOOST_PLAT_WINDOWS_RUNTIME // Preferentially use coalescing timers for better power consumption and timer accuracy - if(timeout != detail::internal_timespec_timepoint::getMax()) + if(timeout != detail::internal_platform_timepoint::getMax()) { - boost::intmax_t const time_left_msec = (timeout - detail::internal_timespec_clock::now()).getMs(); + boost::intmax_t const time_left_msec = (timeout - detail::internal_platform_clock::now()).getMs(); timer_handle=CreateWaitableTimer(NULL,false,NULL); if(timer_handle!=0) { @@ -658,9 +658,9 @@ namespace boost bool const using_timer=timeout_index!=~0u; boost::intmax_t time_left_msec(INFINITE); - if(!using_timer && timeout != detail::internal_timespec_timepoint::getMax()) + if(!using_timer && timeout != detail::internal_platform_timepoint::getMax()) { - time_left_msec = (timeout - detail::internal_timespec_clock::now()).getMs(); + time_left_msec = (timeout - detail::internal_platform_clock::now()).getMs(); if(time_left_msec < 0) { time_left_msec = 0; @@ -696,9 +696,9 @@ namespace boost detail::win32::sleep(static_cast(time_left_msec)); } - if(!using_timer && timeout != detail::internal_timespec_timepoint::getMax()) + if(!using_timer && timeout != detail::internal_platform_timepoint::getMax()) { - time_left_msec = (timeout - detail::internal_timespec_clock::now()).getMs(); + time_left_msec = (timeout - detail::internal_platform_clock::now()).getMs(); } } while(time_left_msec == INFINITE || time_left_msec > 0); @@ -707,7 +707,7 @@ namespace boost namespace no_interruption_point { - bool non_interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_timespec_timepoint const &timeout) + bool non_interruptible_wait(detail::win32::handle handle_to_wait_for, detail::internal_platform_timepoint const &timeout) { detail::win32::handle handles[3]={0}; unsigned handle_count=0; @@ -723,9 +723,9 @@ namespace boost #ifndef UNDER_CE #if !BOOST_PLAT_WINDOWS_RUNTIME // Preferentially use coalescing timers for better power consumption and timer accuracy - if(timeout != detail::internal_timespec_timepoint::getMax()) + if(timeout != detail::internal_platform_timepoint::getMax()) { - boost::intmax_t const time_left_msec = (timeout - detail::internal_timespec_clock::now()).getMs(); + boost::intmax_t const time_left_msec = (timeout - detail::internal_platform_clock::now()).getMs(); timer_handle=CreateWaitableTimer(NULL,false,NULL); if(timer_handle!=0) { @@ -750,9 +750,9 @@ namespace boost bool const using_timer=timeout_index!=~0u; boost::intmax_t time_left_msec(INFINITE); - if(!using_timer && timeout != detail::internal_timespec_timepoint::getMax()) + if(!using_timer && timeout != detail::internal_platform_timepoint::getMax()) { - time_left_msec = (timeout - detail::internal_timespec_clock::now()).getMs(); + time_left_msec = (timeout - detail::internal_platform_clock::now()).getMs(); if(time_left_msec < 0) { time_left_msec = 0; @@ -781,9 +781,9 @@ namespace boost detail::win32::sleep(static_cast(time_left_msec)); } - if(!using_timer && timeout != detail::internal_timespec_timepoint::getMax()) + if(!using_timer && timeout != detail::internal_platform_timepoint::getMax()) { - time_left_msec = (timeout - detail::internal_timespec_clock::now()).getMs(); + time_left_msec = (timeout - detail::internal_platform_clock::now()).getMs(); } } while(time_left_msec == INFINITE || time_left_msec > 0);