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

Unified Diff: base/threading/thread_checker.h

Issue 2165663003: TaskScheduler: Add SequenceToken and ScopedSetSequenceTokenForCurrentThread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improve comment Created 4 years, 5 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
Index: base/threading/thread_checker.h
diff --git a/base/threading/thread_checker.h b/base/threading/thread_checker.h
index 1d970f093ed74b4d8f71c8d0c34006a10f171f3f..87c26ec052dda948d63f376d3c65df476c6fee79 100644
--- a/base/threading/thread_checker.h
+++ b/base/threading/thread_checker.h
@@ -63,6 +63,15 @@ class ThreadCheckerDoNothing {
// ThreadChecker thread_checker_;
// }
//
+// Note that, when enabled, CalledOnValidThread() returns false when called from
+// tasks posted to SingleThreadTaskRunners bound to different sequences, even if
+// the tasks happen to run on the same thread (e.g. two independent TaskRunners
+// with ExecutionMode::SINGLE_THREADED on the TaskScheduler that happen to share
+// a thread). Also, CalledOnValidThread() returns false when called from a non-
+// single-threaded task which is associated with a SequenceToken (e.g. a task
+// posted with ExecutionMode::PARALLEL or ExecutionMode::SEQUENCED to the
gab 2016/07/21 21:14:24 PARALLEL won't have a SequenceToken -- keeping the
fdoray 2016/07/25 13:24:28 keeping the example about SEQUENCED to avoid confu
gab 2016/07/25 14:09:31 Ah right, but IMO that's an implementation detail
+// TaskScheduler).
+//
// In Release mode, CalledOnValidThread will always return true.
#if ENABLE_THREAD_CHECKER
class ThreadChecker : public ThreadCheckerImpl {

Powered by Google App Engine
This is Rietveld 408576698