< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

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


Thanks Dmitry,

I've checked in the fix.

Scott

-----Original Message-----
From: Dmitry Semyonov [mailto:dsemyonov@xxxxxxx] 
Sent: Friday, August 20, 2004 10:22 AM
To: resiprocate-devel@xxxxxxxxxxxxxxxxxxx
Subject: [reSIProcate] Bug in Win32 version of Condition::wait()

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.
_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxxxxxx
https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel