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

Unified Diff: base/synchronization/condition_variable_win.cc

Issue 2047433004: content: Add heartbeat trace for CategorizedWorkerPool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 6 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_unittest.cc ('k') | content/renderer/categorized_worker_pool.h » ('j') | 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 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() {
« no previous file with comments | « base/synchronization/condition_variable_unittest.cc ('k') | content/renderer/categorized_worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698