94 int err = pthread_cond_timedwait(&
theCond, mutex, abstime);
96 if (err == ETIMEDOUT) {
return true; }
108 int ret = gettimeofday(&tv, 0);
110 ts.tv_sec = tv.tv_sec;
111 ts.tv_nsec = tv.tv_usec * 1000;
112 unsigned sec = (unsigned)reltime;
115 unsigned nsec = (unsigned)((reltime - sec)*1e9);
116 if (nsec > 0) ts.tv_nsec += nsec;
118 int err = pthread_cond_timedwait(&
theCond, mutex, &ts);
120 if (err == ETIMEDOUT) {
return true; }
PthreadCondition & Wait(PthreadMutex &mutex)
PthreadCondition & Broadcast(void)
int TimedWait(PthreadMutex &mutex, const timespec *abstime)
void TrapError(int result)
PthreadCondition & Signal(void)