[reSIProcate] Bug in Win32 version of Condition::wait()

Dmitry Semyonov dsemyonov at dins.ru
Fri Aug 20 09:22:11 CDT 2004


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.



More information about the resiprocate-devel mailing list