Skip to content

Commit

Permalink
Fix Windows Condition Variable GetLastError Check
Browse files Browse the repository at this point in the history
During the SleepConditionVariableCS days, the GetLastError was checked
against WAIT_TIMEOUT. This should have been ERROR_TIMEOUT per the docs.

WAIT_TIMEOUT applies to functions like WaitForSingleObject (and more).

BUG=619037

Review-Url: https://codereview.chromium.org/2053403002
Cr-Commit-Position: refs/heads/master@{#399279}
  • Loading branch information
robliao authored and Commit bot committed Jun 10, 2016
1 parent f92801e commit 6162e27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/synchronization/condition_variable_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ void ConditionVariable::TimedWait(const TimeDelta& max_time) {
user_lock_->CheckHeldAndUnmark();
#endif

if (FALSE == SleepConditionVariableSRW(&cv_, srwlock_, timeout, 0)) {
DCHECK(GetLastError() != WAIT_TIMEOUT);
if (!SleepConditionVariableSRW(&cv_, srwlock_, timeout, 0)) {
DCHECK_EQ(static_cast<DWORD>(ERROR_TIMEOUT), GetLastError());
}

#if DCHECK_IS_ON()
Expand Down

0 comments on commit 6162e27

Please sign in to comment.