Index: base/task_scheduler/task_scheduler.h |
diff --git a/base/task_scheduler/task_scheduler.h b/base/task_scheduler/task_scheduler.h |
index 9c7207ef0b550858941960135d39eb8a8baa1628..3d3d5eb08144459a9b5fbe593e57d9db1e0eb7fa 100644 |
--- a/base/task_scheduler/task_scheduler.h |
+++ b/base/task_scheduler/task_scheduler.h |
@@ -33,9 +33,16 @@ namespace base { |
class HistogramBase; |
// Interface for a task scheduler and static methods to manage the instance used |
-// by the post_task.h API. Note: all base/task_scheduler users should go through |
-// post_task.h instead of TaskScheduler except for the one callsite per process |
-// which manages the process' instance. |
+// by the post_task.h API. |
+// |
+// The task scheduler doesn't create threads until Start() is called. Tasks can |
+// be posted at any time but will not run until after Start() is called. |
+// |
+// The instance methods of this class are thread-safe. |
+// |
+// Note: All base/task_scheduler users should go through post_task.h instead of |
+// TaskScheduler except for the one callsite per process which manages the |
+// process's instance. |
class BASE_EXPORT TaskScheduler { |
public: |
struct BASE_EXPORT InitParams { |
@@ -59,6 +66,10 @@ class BASE_EXPORT TaskScheduler { |
// returned. |
virtual ~TaskScheduler() = default; |
+ // Allows the task scheduler to create threads and run tasks following the |
+ // |init_params| specification. CHECKs on failure. |
+ virtual void Start(const InitParams& init_params) = 0; |
+ |
// Posts |task| with a |delay| and specific |traits|. |delay| can be zero. |
// For one off tasks that don't require a TaskRunner. |
virtual void PostDelayedTaskWithTraits( |