diff options
author | Alyssa Milburn | 2012-08-25 13:50:44 +0200 |
---|---|---|
committer | Alyssa Milburn | 2012-08-25 14:05:04 +0200 |
commit | f4b83283f3c7ee9a1d857d1ce19321de0196e685 (patch) | |
tree | 596c67d44be63233eb602d4ff3072e84fe7a8639 /common | |
parent | 8b0dca3862da10e87fe0fec237c694c48e12f83c (diff) | |
download | scummvm-rg350-f4b83283f3c7ee9a1d857d1ce19321de0196e685.tar.gz scummvm-rg350-f4b83283f3c7ee9a1d857d1ce19321de0196e685.tar.bz2 scummvm-rg350-f4b83283f3c7ee9a1d857d1ce19321de0196e685.zip |
COMMON: Fix waiting for multiple coroutine events.
This fixes the bWaitAll case of waitForMultipleObjects, and also the
resetting of events later in the function.
Diffstat (limited to 'common')
-rw-r--r-- | common/coroutines.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/coroutines.cpp b/common/coroutines.cpp index 9ef7c73e38..cb9e61cbc6 100644 --- a/common/coroutines.cpp +++ b/common/coroutines.cpp @@ -475,9 +475,9 @@ void CoroutineScheduler::waitForMultipleObjects(CORO_PARAM, int nCount, uint32 * // Determine the signalled state _ctx->pidSignalled = (_ctx->pProcess) || !_ctx->pEvent ? false : _ctx->pEvent->signalled; - if (bWaitAll && _ctx->pidSignalled) + if (bWaitAll && !_ctx->pidSignalled) _ctx->signalled = false; - else if (!bWaitAll & _ctx->pidSignalled) + else if (!bWaitAll && _ctx->pidSignalled) _ctx->signalled = true; } @@ -487,7 +487,7 @@ void CoroutineScheduler::waitForMultipleObjects(CORO_PARAM, int nCount, uint32 * for (_ctx->i = 0; _ctx->i < nCount; ++_ctx->i) { _ctx->pEvent = getEvent(pidList[_ctx->i]); - if (_ctx->pEvent->manualReset) + if (!_ctx->pEvent->manualReset) _ctx->pEvent->signalled = false; } |