diff -Naur org/include/RCF/thread/impl/posix_event.ipp mod/include/RCF/thread/impl/posix_event.ipp --- org/include/RCF/thread/impl/posix_event.ipp 2013-02-13 01:18:14.000000000 +0100 +++ mod/include/RCF/thread/impl/posix_event.ipp 2014-10-19 18:37:08.000000000 +0200 @@ -44,7 +44,10 @@ posix_event::posix_event() { - int error = ::pthread_cond_init(&cond_, 0); + ::pthread_condattr_init(&condattr_); + ::pthread_condattr_setclock(&condattr_, CLOCK_MONOTONIC); + + int error = ::pthread_cond_init(&cond_, &condattr_); RCF_VERIFY(error == 0, Exception(_RcfError_ThreadingError("pthread_cond_init()"), error)); } diff -Naur org/include/RCF/thread/posix_event.hpp mod/include/RCF/thread/posix_event.hpp --- org/include/RCF/thread/posix_event.hpp 2013-02-13 01:18:14.000000000 +0100 +++ mod/include/RCF/thread/posix_event.hpp 2014-10-19 18:37:08.000000000 +0200 @@ -100,13 +100,8 @@ { BOOST_ASSERT(lock.locked()); - struct timeval tp = {0}; - gettimeofday(&tp, NULL); - - // Convert from timeval to timespec. struct timespec ts = {0}; - ts.tv_sec = tp.tv_sec; - ts.tv_nsec = tp.tv_usec * 1000; + clock_gettime(CLOCK_MONOTONIC, &ts); // Add waitMs to current time. ts.tv_sec += (waitMs / 1000); @@ -141,6 +136,7 @@ protected: ::pthread_cond_t cond_; + ::pthread_condattr_t condattr_; }; } // namespace detail