Index: base/task_scheduler/scheduler_worker_thread.h |
diff --git a/base/task_scheduler/scheduler_worker_thread.h b/base/task_scheduler/scheduler_worker_thread.h |
index 6721309180ca56ae0fdb26b4cff7a6989f77b3e9..f0b03d18296348ed6cdf97cadc8437591e65045a 100644 |
--- a/base/task_scheduler/scheduler_worker_thread.h |
+++ b/base/task_scheduler/scheduler_worker_thread.h |
@@ -7,6 +7,7 @@ |
#include <memory> |
+#include "base/atomicops.h" |
#include "base/base_export.h" |
#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
@@ -83,6 +84,10 @@ class BASE_EXPORT SchedulerWorkerThread : public PlatformThread::Delegate, |
scoped_refptr<SingleThreadTaskRunner> CreateTaskRunnerWithTraits( |
const TaskTraits& traits); |
+ // Returns the number of single-thread TaskRunners associated with this |
+ // SchedulerWorkerThread. |
+ size_t GetNumSingleThreadTaskRunners() const; |
+ |
// Wakes up this SchedulerWorkerThread if it wasn't already awake. After this |
// is called, this SchedulerWorkerThread will run Tasks from Sequences |
// returned by the GetWork() method of its delegate until it returns nullptr. |
@@ -114,6 +119,10 @@ class BASE_EXPORT SchedulerWorkerThread : public PlatformThread::Delegate, |
// Event signaled to wake up this SchedulerWorkerThread. |
WaitableEvent wake_up_event_; |
+ // Number of single-thread TaskRunners associated with this |
+ // SchedulerWorkerThread. |
+ base::subtle::Atomic32 num_single_thread_task_runners_; |
+ |
// PriorityQueue for Tasks/Sequences posted through SingleThreadTaskRunners |
// returned by CreateTaskRunnerWithTraits. |
PriorityQueue single_threaded_priority_queue_; |