Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86379 - trunk/boost/sync/detail
From: andrey.semashev_at_[hidden]
Date: 2013-10-21 06:23:24


Author: andysem
Date: 2013-10-21 06:23:24 EDT (Mon, 21 Oct 2013)
New Revision: 86379
URL: http://svn.boost.org/trac/boost/changeset/86379

Log:
Use gettimeofday for system clock on Mach platform.

Text files modified:
   trunk/boost/sync/detail/time_units.hpp | 6 ++++++
   1 files changed, 6 insertions(+), 0 deletions(-)

Modified: trunk/boost/sync/detail/time_units.hpp
==============================================================================
--- trunk/boost/sync/detail/time_units.hpp Mon Oct 21 05:21:35 2013 (r86378)
+++ trunk/boost/sync/detail/time_units.hpp 2013-10-21 06:23:24 EDT (Mon, 21 Oct 2013) (r86379)
@@ -20,6 +20,8 @@
 
 #if defined(BOOST_SYNC_DETAIL_PLATFORM_WINAPI)
 #include <boost/detail/winapi/time.hpp>
+#elif defined(BOOST_SYNC_DETAIL_PLATFORM_MACH)
+#include <sys/time.h> // gettimeofday, timeval
 #endif
 
 #include <boost/sync/detail/header.hpp>
@@ -182,6 +184,10 @@
         system_time_point t;
         ::clock_gettime(CLOCK_REALTIME, &t.m_value);
         return t;
+#elif defined(BOOST_SYNC_DETAIL_PLATFORM_MACH)
+ ::timeval tv;
+ ::gettimeofday(&tv, 0);
+ return system_time_point(tv.tv_sec, tv.tv_usec * (subsecond_fraction / 1000000u));
 #else
         return system_time_point(::time(0));
 #endif


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk