+ Time::TimeStamp ts = Time::now()+d;
+
+ timespec timeout;
+ timeout.tv_sec = ts.raw()/1000000;
+ timeout.tv_nsec = (ts.raw()%1000000)*1000;
+
+ int err = pthread_cond_timedwait(&priv->cond, &priv->mutex.priv->mutex, &timeout);
+ if(err && err!=ETIMEDOUT)
+ throw system_error("Semaphore::wait", err);
+ return err==0;