summaryrefslogtreecommitdiffstats
path: root/js/src/threading/windows/ConditionVariable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/threading/windows/ConditionVariable.cpp')
-rw-r--r--js/src/threading/windows/ConditionVariable.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/js/src/threading/windows/ConditionVariable.cpp b/js/src/threading/windows/ConditionVariable.cpp
index 3c75a0f27..92e0249b7 100644
--- a/js/src/threading/windows/ConditionVariable.cpp
+++ b/js/src/threading/windows/ConditionVariable.cpp
@@ -54,8 +54,8 @@ js::ConditionVariable::notify_all()
void
js::ConditionVariable::wait(UniqueLock<Mutex>& lock)
{
- CRITICAL_SECTION* cs = &lock.lock.platformData()->criticalSection;
- bool r = SleepConditionVariableCS(&platformData()->cv_, cs, INFINITE);
+ SRWLOCK* srwlock = &lock.lock.platformData()->lock;
+ bool r = SleepConditionVariableSRW(&platformData()->cv_, srwlock, INFINITE, 0);
MOZ_RELEASE_ASSERT(r);
}
@@ -70,7 +70,7 @@ js::CVStatus
js::ConditionVariable::wait_for(UniqueLock<Mutex>& lock,
const mozilla::TimeDuration& rel_time)
{
- CRITICAL_SECTION* cs = &lock.lock.platformData()->criticalSection;
+ SRWLOCK* srwlock = &lock.lock.platformData()->lock;
// Note that DWORD is unsigned, so we have to be careful to clamp at 0.
// If rel_time is Forever, then ToMilliseconds is +inf, which evaluates as
@@ -82,7 +82,7 @@ js::ConditionVariable::wait_for(UniqueLock<Mutex>& lock,
? INFINITE
: static_cast<DWORD>(msecd);
- BOOL r = SleepConditionVariableCS(&platformData()->cv_, cs, msec);
+ BOOL r = SleepConditionVariableSRW(&platformData()->cv_, srwlock, msec, 0);
if (r)
return CVStatus::NoTimeout;
MOZ_RELEASE_ASSERT(GetLastError() == ERROR_TIMEOUT);