]> 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 b7151e34af517af94bffb7e04b73c64d2315bb14..8fa1be90f7c7e234abde3e74409bfb916acbffb9 100644 (file)
@@ -1,16 +1,10 @@
-/* $Id$
-
-This file is part of libmspcore
-Copyright © 2006  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifdef WIN32
 #include <windows.h>
 #else
 #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>
@@ -92,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)