From: Mikko Rasa Date: Sat, 28 May 2011 13:00:46 +0000 (+0300) Subject: Use the timespec conversion in Semaphore::wait X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=commitdiff_plain;h=6728e37df7f74130689d3829a1466422451735e3 Use the timespec conversion in Semaphore::wait --- diff --git a/source/core/semaphore.cpp b/source/core/semaphore.cpp index 544fb27..b7151e3 100644 --- a/source/core/semaphore.cpp +++ b/source/core/semaphore.cpp @@ -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)