X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fsemaphore.cpp;h=e923ca8835efb7e3e7b59e4afd2f6ec4e92c078e;hb=79482ba7aea1b79c7a310c940cc0292532ef3bcb;hp=544fb27f81b192731f4175b97257f7b6e534268c;hpb=a1d6fa071280123f282c1bac3b68008672401024;p=libs%2Fcore.git diff --git a/source/core/semaphore.cpp b/source/core/semaphore.cpp index 544fb27..e923ca8 100644 --- a/source/core/semaphore.cpp +++ b/source/core/semaphore.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspcore -Copyright © 2006 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifdef WIN32 #include #else @@ -92,11 +85,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)