]> git.tdb.fi Git - libs/core.git/commitdiff
Use the timespec conversion in Semaphore::wait
authorMikko Rasa <tdb@tdb.fi>
Sat, 28 May 2011 13:00:46 +0000 (16:00 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 28 May 2011 13:00:46 +0000 (16:00 +0300)
source/core/semaphore.cpp

index 544fb27f81b192731f4175b97257f7b6e534268c..b7151e34af517af94bffb7e04b73c64d2315bb14 100644 (file)
@@ -92,11 +92,7 @@ bool Semaphore::wait(const Time::TimeDelta &d)
                throw system_error("Semaphore::wait");
        return ret==WAIT_OBJECT_0;
 #else
-       Time::TimeStamp ts = Time::now()+d;
-
-       timespec timeout;
-       timeout.tv_sec = ts.raw()/1000000;
-       timeout.tv_nsec = (ts.raw()%1000000)*1000;
+       timespec timeout = Time::now()+d;
 
        int err = pthread_cond_timedwait(&priv->cond, &priv->mutex.priv->mutex, &timeout);
        if(err && err!=ETIMEDOUT)