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

Unified Diff: base/synchronization/waitable_event_posix.cc

Issue 10151009: Disallow UI/IO thread blocking on any other thread. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 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_win.cc ('k') | base/synchronization/waitable_event_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/synchronization/waitable_event_posix.cc
===================================================================
--- base/synchronization/waitable_event_posix.cc (revision 133458)
+++ base/synchronization/waitable_event_posix.cc (working copy)
@@ -5,11 +5,11 @@
#include <algorithm>
#include <vector>
+#include "base/logging.h"
#include "base/synchronization/waitable_event.h"
-
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
-#include "base/logging.h"
+#include "base/threading/thread_restrictions.h"
// -----------------------------------------------------------------------------
// A WaitableEvent on POSIX is implemented as a wait-list. Currently we don't
@@ -158,6 +158,7 @@
}
bool WaitableEvent::TimedWait(const TimeDelta& max_time) {
+ base::ThreadRestrictions::AssertWaitAllowed();
const Time end_time(Time::Now() + max_time);
const bool finite_time = max_time.ToInternalValue() >= 0;
@@ -224,6 +225,7 @@
// static
size_t WaitableEvent::WaitMany(WaitableEvent** raw_waitables,
size_t count) {
+ base::ThreadRestrictions::AssertWaitAllowed();
DCHECK(count) << "Cannot wait on no events";
// We need to acquire the locks in a globally consistent order. Thus we sort
« no previous file with comments | « base/synchronization/condition_variable_win.cc ('k') | base/synchronization/waitable_event_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698