Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1085)

Unified Diff: base/synchronization/condition_variable_win.cc

Issue 2341773003: Add Some Comments to the Timeout Checks on Condition Variables (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/synchronization/condition_variable_posix.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/synchronization/condition_variable_win.cc
diff --git a/base/synchronization/condition_variable_win.cc b/base/synchronization/condition_variable_win.cc
index d5f24e4438753471dc38b0e48a0ae680477eafb2..8bece6eb34dbfc965ccee65b08051c54ad9fff79 100644
--- a/base/synchronization/condition_variable_win.cc
+++ b/base/synchronization/condition_variable_win.cc
@@ -35,6 +35,11 @@ void ConditionVariable::TimedWait(const TimeDelta& max_time) {
#endif
if (!SleepConditionVariableSRW(&cv_, srwlock_, timeout, 0)) {
+ // On failure, we only expect the CV to timeout. Any other error value means
+ // that we've unexpectedly woken up.
+ // Note that WAIT_TIMEOUT != ERROR_TIMEOUT. WAIT_TIMEOUT is used with the
+ // WaitFor* family of functions as a direct return value. ERROR_TIMEOUT is
+ // used with GetLastError().
DCHECK_EQ(static_cast<DWORD>(ERROR_TIMEOUT), GetLastError());
}
« no previous file with comments | « base/synchronization/condition_variable_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698