diff options
| author | Eric Holk <eholk@mozilla.com> | 2011-07-28 10:41:48 -0700 |
|---|---|---|
| committer | Eric Holk <eholk@mozilla.com> | 2011-07-28 10:47:29 -0700 |
| commit | 3d7016ae9575a36fd96ec264274bbe0c660a7758 (patch) | |
| tree | 35ecc1c85c3b818ab8b02101d5b72908e07251b4 /src/rt/sync | |
| parent | 9618ab67ae8fc6e82bb16e29ea52125acf183fc8 (diff) | |
Updating to work on Windows.
Diffstat (limited to 'src/rt/sync')
| -rw-r--r-- | src/rt/sync/lock_and_signal.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rt/sync/lock_and_signal.cpp b/src/rt/sync/lock_and_signal.cpp index 67f6b107b3a..df596c65cb2 100644 --- a/src/rt/sync/lock_and_signal.cpp +++ b/src/rt/sync/lock_and_signal.cpp @@ -73,7 +73,8 @@ bool lock_and_signal::timed_wait(size_t timeout_in_ns) { bool rv = true; #if defined(__WIN32__) LeaveCriticalSection(&_cs); - WaitForSingleObject(_event, INFINITE); + DWORD timeout = timeout_in_ns == 0 ? INFINITE : timeout_in_ns / 1000000; + rv = WaitForSingleObject(_event, timeout) != WAIT_TIMEOUT; EnterCriticalSection(&_cs); _holding_thread = GetCurrentThreadId(); #else |
