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

Unified Diff: base/threading/thread_restrictions.cc

Issue 2925843002: Add TaskTraits hints to AssertIO/WaitAllowed messages. (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/thread_restrictions.cc
diff --git a/base/threading/thread_restrictions.cc b/base/threading/thread_restrictions.cc
index 8dd77433325f075e2741086368612ae2c8c6eb3f..b6563d58531758d91199ed8cd0f80d6f7aa1c2a7 100644
--- a/base/threading/thread_restrictions.cc
+++ b/base/threading/thread_restrictions.cc
@@ -35,12 +35,13 @@ bool ThreadRestrictions::SetIOAllowed(bool allowed) {
// static
void ThreadRestrictions::AssertIOAllowed() {
if (g_io_disallowed.Get().Get()) {
- NOTREACHED() <<
- "Function marked as IO-only was called from a thread that "
- "disallows IO! If this thread really should be allowed to "
- "make IO calls, adjust the call to "
- "base::ThreadRestrictions::SetIOAllowed() in this thread's "
- "startup.";
+ NOTREACHED() << "Function marked as IO-only was called from a thread that "
+ "disallows IO! If this thread really should be allowed to "
+ "make IO calls, adjust the call to "
+ "base::ThreadRestrictions::SetIOAllowed() in this thread's "
+ "startup. If this task is running inside the "
+ "TaskScheduler, the TaskRunner used to post it needs to "
+ "have MayBlock() in its TaskTraits.";
}
}
@@ -74,7 +75,9 @@ void ThreadRestrictions::DisallowWaiting() {
void ThreadRestrictions::AssertWaitAllowed() {
if (g_wait_disallowed.Get().Get()) {
NOTREACHED() << "Waiting is not allowed to be used on this thread to "
- << "prevent jank and deadlock.";
+ << "prevent jank and deadlock. If this task is running "
+ "inside the TaskScheduler, the TaskRunner used to post it "
+ "needs to have WithBaseSyncPrimitives() in its TaskTraits.";
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698