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

Unified Diff: base/synchronization/waitable_event_win.cc

Issue 2303943003: Ensure that |Thread::id_| is only accessed when an happens-after relationship has been established … (Closed)
Patch Set: Only AssertWaitAllowed() in WaitableEvent::TimedWait if time is non-zero 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 | « no previous file | base/threading/thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/synchronization/waitable_event_win.cc
diff --git a/base/synchronization/waitable_event_win.cc b/base/synchronization/waitable_event_win.cc
index cbdebbb082cd2a2ab8f223904c0aee26dc3b74a7..d80cabb3ff3ae864fb25f54448885d2c252c5f2b 100644
--- a/base/synchronization/waitable_event_win.cc
+++ b/base/synchronization/waitable_event_win.cc
@@ -62,8 +62,10 @@ bool WaitableEvent::TimedWait(const TimeDelta& max_time) {
// Record the event that this thread is blocking upon (for hang diagnosis).
base::debug::ScopedEventWaitActivity event_activity(this);
- base::ThreadRestrictions::AssertWaitAllowed();
DCHECK_GE(max_time, TimeDelta());
+ if (!max_time.is_zero())
+ base::ThreadRestrictions::AssertWaitAllowed();
+
// Truncate the timeout to milliseconds. The API specifies that this method
// can return in less than |max_time| (when returning false), as the argument
// is the maximum time that a caller is willing to wait.
« no previous file with comments | « no previous file | base/threading/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698