Chromium Code Reviews| 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..b701b5de0774f30db890a7a46a94fc5db2fa1635 100644 |
| --- a/base/synchronization/condition_variable_win.cc |
| +++ b/base/synchronization/condition_variable_win.cc |
| @@ -26,8 +26,9 @@ void ConditionVariable::Wait() { |
| TimedWait(TimeDelta::FromMilliseconds(INFINITE)); |
| } |
| -void ConditionVariable::TimedWait(const TimeDelta& max_time) { |
| +bool ConditionVariable::TimedWait(const TimeDelta& max_time) { |
| base::ThreadRestrictions::AssertWaitAllowed(); |
| + bool timed_out = false; |
|
robliao
2016/06/07 15:40:30
Minimal scope: Move to right before the if check b
|
| DWORD timeout = static_cast<DWORD>(max_time.InMilliseconds()); |
| #if DCHECK_IS_ON() |
| @@ -35,12 +36,15 @@ void ConditionVariable::TimedWait(const TimeDelta& max_time) { |
| #endif |
| if (FALSE == SleepConditionVariableSRW(&cv_, srwlock_, timeout, 0)) { |
| - DCHECK(GetLastError() != WAIT_TIMEOUT); |
| + timed_out = GetLastError() == WAIT_TIMEOUT; |
|
robliao
2016/06/07 15:40:30
Looks like your changelist uncovered a longstandin
prashant.n
2016/06/07 15:49:54
I just copied earlier code, I'll make chnages sugg
|
| + DCHECK(max_time != TimeDelta::FromMilliseconds(INFINITE) || !timed_out); |
|
robliao
2016/06/07 15:40:30
This DCHECK will pass all cases where max_time is
prashant.n
2016/06/07 15:49:54
I'll correct this. May be I'll add two explicit dc
|
| } |
| #if DCHECK_IS_ON() |
| user_lock_->CheckUnheldAndMark(); |
| #endif |
| + |
| + return timed_out; |
| } |
| void ConditionVariable::Broadcast() { |