summaryrefslogtreecommitdiff
path: root/boost/thread/pthread/timespec.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:11:01 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:11:01 +0900
commit3fdc3e5ee96dca5b11d1694975a65200787eab86 (patch)
tree5c1733853892b8397d67706fa453a9bd978d2102 /boost/thread/pthread/timespec.hpp
parent88e602c57797660ebe0f9e15dbd64c1ff16dead3 (diff)
downloadboost-3fdc3e5ee96dca5b11d1694975a65200787eab86.tar.gz
boost-3fdc3e5ee96dca5b11d1694975a65200787eab86.tar.bz2
boost-3fdc3e5ee96dca5b11d1694975a65200787eab86.zip
Imported Upstream version 1.66.0upstream/1.66.0
Diffstat (limited to 'boost/thread/pthread/timespec.hpp')
-rw-r--r--boost/thread/pthread/timespec.hpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/boost/thread/pthread/timespec.hpp b/boost/thread/pthread/timespec.hpp
index 74583ed0eb..1fb8de94c8 100644
--- a/boost/thread/pthread/timespec.hpp
+++ b/boost/thread/pthread/timespec.hpp
@@ -71,32 +71,21 @@ namespace boost
{
return (ts.tv_sec >= 0) || (ts.tv_nsec >= 0);
}
- inline timespec timespec_now()
+#if defined BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC
+
+ inline timespec timespec_now_monotonic()
{
timespec ts;
-#if defined CLOCK_MONOTONIC && defined BOOST_THREAD_USEFIXES_TIMESPEC
if ( ::clock_gettime( CLOCK_MONOTONIC, &ts ) )
{
ts.tv_sec = 0;
ts.tv_nsec = 0;
BOOST_ASSERT(0 && "Boost::Thread - Internal Error");
}
-#elif defined(BOOST_THREAD_TIMESPEC_MAC_API)
- timeval tv;
- ::gettimeofday(&tv, 0);
- ts.tv_sec = tv.tv_sec;
- ts.tv_nsec = tv.tv_usec * 1000;
-#else
- if ( ::clock_gettime( CLOCK_REALTIME, &ts ) )
- {
- ts.tv_sec = 0;
- ts.tv_nsec = 0;
- BOOST_ASSERT(0 && "Boost::Thread - Internal Error");
- }
-#endif
return ts;
}
+#endif
inline timespec timespec_now_realtime()
{