summaryrefslogtreecommitdiff
path: root/cpp/include/IceUtil/Cond.h
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2012-02-21 17:04:50 +0100
committerJose <jose@zeroc.com>2012-02-21 17:04:50 +0100
commit31f1254d83018687a36d40d07d878ec07bfbe7c4 (patch)
tree31da873dd8c19f3f0ce5b10b71ea0f815d08a0c8 /cpp/include/IceUtil/Cond.h
parentICE-4588 - DynamicLibrary & LoadLibraryW (diff)
downloadice-31f1254d83018687a36d40d07d878ec07bfbe7c4.tar.bz2
ice-31f1254d83018687a36d40d07d878ec07bfbe7c4.tar.xz
ice-31f1254d83018687a36d40d07d878ec07bfbe7c4.zip
ICE-4740 - Timer for mac doesn't implement monotonic time
Diffstat (limited to 'cpp/include/IceUtil/Cond.h')
-rw-r--r--cpp/include/IceUtil/Cond.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/cpp/include/IceUtil/Cond.h b/cpp/include/IceUtil/Cond.h
index 4c7f4b34bde..fe6c676b7cc 100644
--- a/cpp/include/IceUtil/Cond.h
+++ b/cpp/include/IceUtil/Cond.h
@@ -234,7 +234,11 @@ Cond::timedWaitImpl(const M& mutex, const Time& timeout) const
LockState state;
mutex.unlock(state);
+#ifdef __APPLE__
+ timeval tv = Time::now(Time::Realtime) + timeout;
+#else
timeval tv = Time::now(Time::Monotonic) + timeout;
+#endif
timespec ts;
ts.tv_sec = tv.tv_sec;
ts.tv_nsec = tv.tv_usec * 1000;