summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2001-10-16 23:52:53 +0000
committerwtc%netscape.com <devnull@localhost>2001-10-16 23:52:53 +0000
commit415661f3132446b3b11a8538996138aa9dee15a7 (patch)
treea2fc3be1b578e77f895385d21f80f2a1b9c1e067
parent32ffc1502bbde1e95922d093d70f39537d944114 (diff)
downloadnspr-hg-415661f3132446b3b11a8538996138aa9dee15a7.tar.gz
Bugzilla bug 105154: fixed a timing problem in OS/2's implementation of
condition variables. Thanks to Aaron Read <aaronr@us.ibm.com> for the patch. r=wtc. Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
-rw-r--r--pr/src/md/os2/os2cv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pr/src/md/os2/os2cv.c b/pr/src/md/os2/os2cv.c
index 30e40f9b..e5c026e3 100644
--- a/pr/src/md/os2/os2cv.c
+++ b/pr/src/md/os2/os2cv.c
@@ -275,7 +275,9 @@ _PR_MD_WAIT_CV(_MDCVar *cv, _MDLock *lock, PRIntervalTime timeout )
/* Wait for notification or timeout; don't really care which */
rv = DosWaitEventSem(thred->md.blocked_sema.sem, msecs);
- DosResetEventSem(thred->md.blocked_sema.sem, &count);
+ if (rv == NO_ERROR) {
+ DosResetEventSem(thred->md.blocked_sema.sem, &count);
+ }
DosRequestMutexSem((lock->mutex), SEM_INDEFINITE_WAIT);
@@ -314,7 +316,9 @@ _PR_MD_WAIT_CV(_MDCVar *cv, _MDLock *lock, PRIntervalTime timeout )
* non-signaled. We assume this wait won't take long.
*/
rv = DosWaitEventSem(thred->md.blocked_sema.sem, SEM_INDEFINITE_WAIT);
- DosResetEventSem(thred->md.blocked_sema.sem, &count);
+ if (rv == NO_ERROR) {
+ DosResetEventSem(thred->md.blocked_sema.sem, &count);
+ }
PR_ASSERT(rv == NO_ERROR);
}
}