diff --git a/uppsrc/Core/Mt.cpp b/uppsrc/Core/Mt.cpp index 748a57c68..b06ef455a 100644 --- a/uppsrc/Core/Mt.cpp +++ b/uppsrc/Core/Mt.cpp @@ -637,7 +637,7 @@ RWMutex::~RWMutex() pthread_rwlock_destroy(rwlock); } -void ConditionVariable::Wait(Mutex& m, int timeout_ms) +bool ConditionVariable::Wait(Mutex& m, int timeout_ms) { struct timespec until; clock_gettime(CLOCK_REALTIME, &until); @@ -648,7 +648,7 @@ void ConditionVariable::Wait(Mutex& m, int timeout_ms) until.tv_sec += until.tv_nsec / 1000000000; until.tv_nsec %= 1000000000; - return pthread_cond_timedwait(cv, m.mutex, &until); + return pthread_cond_timedwait(cv, m.mutex, &until) == 0; } #ifdef PLATFORM_OSX diff --git a/uppsrc/Core/Mt.h b/uppsrc/Core/Mt.h index 9600cf75e..216902ed6 100644 --- a/uppsrc/Core/Mt.h +++ b/uppsrc/Core/Mt.h @@ -205,7 +205,7 @@ class ConditionVariable { public: void Wait(Mutex& m); - void Wait(Mutex& m, int timeout_ms); + bool Wait(Mutex& m, int timeout_ms); void Signal(); void Broadcast(); @@ -262,7 +262,7 @@ class ConditionVariable { public: void Wait(Mutex& m) { pthread_cond_wait(cv, m.mutex); } - void Wait(Mutex& m, int timeout_ms); + bool Wait(Mutex& m, int timeout_ms); void Signal() { pthread_cond_signal(cv); } void Broadcast() { pthread_cond_broadcast(cv); }