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

Unified Diff: base/task_scheduler/scheduler_worker.h

Issue 2628313004: Add TaskScheduler::JoinForTesting(). (Closed)
Patch Set: self-review Created 3 years, 11 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/task_scheduler/scheduler_worker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/scheduler_worker.h
diff --git a/base/task_scheduler/scheduler_worker.h b/base/task_scheduler/scheduler_worker.h
index f75d45f25db95d3f5c1009726274f30d7d1f9eab..87fd8ed7462e9c89b6bcf569b7c3d46f8c51fab6 100644
--- a/base/task_scheduler/scheduler_worker.h
+++ b/base/task_scheduler/scheduler_worker.h
@@ -76,8 +76,6 @@ class BASE_EXPORT SchedulerWorker {
// - The next WakeUp() could be more costly due to new thread creation.
// - The worker will take this as a signal that it can detach, but it is not
// obligated to do so.
- // This MUST return false if SchedulerWorker::JoinForTesting() is in
- // progress.
virtual bool CanDetach(SchedulerWorker* worker) = 0;
// Called by a thread before it detaches. This method is not allowed to
@@ -117,6 +115,10 @@ class BASE_EXPORT SchedulerWorker {
// Joins this SchedulerWorker. If a Task is already running, it will be
// allowed to complete its execution. This can only be called once.
+ //
+ // Note: A thread that detaches before JoinForTesting() is called may still be
+ // running after JoinForTesting() returns. However, it can't run tasks after
+ // JoinForTesting() returns.
void JoinForTesting();
// Returns true if the worker is alive.
« no previous file with comments | « no previous file | base/task_scheduler/scheduler_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698