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

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
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..807dc63c4c6beec08c1da46f9a166dbfda7971c4 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 which detaches itself before JoinForTesting() is called may
robliao 2017/01/24 18:20:18 This might be clearer: A thread that detaches befo
fdoray 2017/01/24 20:03:51 Done.
+ // not exit before JoinForTesting() returns. However, it can't run tasks after
+ // JoinForTesting() has returned.
void JoinForTesting();
// Returns true if the worker is alive.
« no previous file with comments | « no previous file | base/task_scheduler/scheduler_worker.cc » ('j') | base/task_scheduler/scheduler_worker_pool_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698