Index: base/synchronization/condition_variable_win.cc |
diff --git a/base/synchronization/condition_variable_win.cc b/base/synchronization/condition_variable_win.cc |
index 61c6a715e0eccd8557338193f7f8313ab431b9ce..672dbec22fb82be120a840259a5b95ed7c761a3f 100644 |
--- a/base/synchronization/condition_variable_win.cc |
+++ b/base/synchronization/condition_variable_win.cc |
@@ -26,7 +26,7 @@ void ConditionVariable::Wait() { |
TimedWait(TimeDelta::FromMilliseconds(INFINITE)); |
} |
-void ConditionVariable::TimedWait(const TimeDelta& max_time) { |
+bool ConditionVariable::TimedWait(const TimeDelta& max_time) { |
base::ThreadRestrictions::AssertWaitAllowed(); |
DWORD timeout = static_cast<DWORD>(max_time.InMilliseconds()); |
@@ -34,13 +34,17 @@ void ConditionVariable::TimedWait(const TimeDelta& max_time) { |
user_lock_->CheckHeldAndUnmark(); |
#endif |
+ bool timed_out = false; |
if (FALSE == SleepConditionVariableSRW(&cv_, srwlock_, timeout, 0)) { |
- DCHECK(GetLastError() != WAIT_TIMEOUT); |
+ timed_out = GetLastError() == ERROR_TIMEOUT; |
+ DCHECK(timed_out); |
} |
#if DCHECK_IS_ON() |
user_lock_->CheckUnheldAndMark(); |
#endif |
+ |
+ return timed_out; |
} |
void ConditionVariable::Broadcast() { |