summaryrefslogtreecommitdiff
path: root/pr/src/md/os2/os2cv.c
diff options
context:
space:
mode:
Diffstat (limited to 'pr/src/md/os2/os2cv.c')
-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);
}
}