[reSIProcate] Bug in Win32 version of Condition::wait()
- From: Dmitry Semyonov <dsemyonov@xxxxxxx>
- Date: Fri, 20 Aug 2004 18:22:11 +0400 (MSD)
Hi!
Win32 version of condition::wait(Mutex* mutex, int ms) always returns
true. Please, apply the included patch to fix the bug.
Index: resiprocate/sip/resiprocate/os/Condition.cxx
===================================================================
--- resiprocate/sip/resiprocate/os/Condition.cxx (revision 3276)
+++ resiprocate/sip/resiprocate/os/Condition.cxx (working copy)
@@ -157,9 +157,10 @@
// keep track of a counter (see the above link for more info).
This can be
// easily added in the future if required.
mutex->unlock();
- WaitForSingleObject(mId, ms);
+ DWORD ret = WaitForSingleObject(mId, ms);
mutex->lock();
- return true;
+ assert(ret != WAIT_FAILED);
+ return (ret == WAIT_OBJECT_0);
#else
timeval waitTime;
gettimeofday( &waitTime, NULL );
...Bye..Dmitry.