diff options
author | wtc%netscape.com <devnull@localhost> | 2001-10-16 23:54:24 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2001-10-16 23:54:24 +0000 |
commit | fd9b17f9d5efa8fed8256a68d6e15532651101b8 (patch) | |
tree | 84fdfaf32fae1df69fd9ecf03f4515b35e002399 | |
parent | 80e14a42d78da9e7ea3d06689ea1642e922b55a4 (diff) | |
download | nspr-hg-fd9b17f9d5efa8fed8256a68d6e15532651101b8.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.
-rw-r--r-- | pr/src/md/os2/os2cv.c | 8 |
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); } } |