]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/semaphore.cpp
Isolate platform-dependent RawTime conversion functions to a private header
[libs/core.git] / source / core / semaphore.cpp
index e923ca8835efb7e3e7b59e4afd2f6ec4e92c078e..8fa1be90f7c7e234abde3e74409bfb916acbffb9 100644 (file)
@@ -4,6 +4,7 @@
 #include <sys/time.h>
 #include <cerrno>
 #endif
+#include <msp/time/rawtime_private.h>
 #include <msp/time/timestamp.h>
 #include <msp/time/units.h>
 #include <msp/time/utils.h>
@@ -85,7 +86,7 @@ bool Semaphore::wait(const Time::TimeDelta &d)
                throw system_error("Semaphore::wait");
        return ret==WAIT_OBJECT_0;
 #else
-       timespec timeout = Time::now()+d;
+       timespec timeout = Time::rawtime_to_timespec((Time::now()+d).raw());
 
        int err = pthread_cond_timedwait(&priv->cond, &priv->mutex.priv->mutex, &timeout);
        if(err && err!=ETIMEDOUT)