Index: base/task_scheduler/scheduler_worker_pool_params.h |
diff --git a/base/task_scheduler/scheduler_worker_pool_params.h b/base/task_scheduler/scheduler_worker_pool_params.h |
index bba785599096c336ccdcea0aad54694ee8faf4ce..f0e41327aeb1a943a610e50e9fb3959e0f468b62 100644 |
--- a/base/task_scheduler/scheduler_worker_pool_params.h |
+++ b/base/task_scheduler/scheduler_worker_pool_params.h |
@@ -21,6 +21,13 @@ class BASE_EXPORT SchedulerWorkerPoolParams final { |
DISALLOWED, |
}; |
+ enum class StandbyThreadPolicy { |
+ // Create threads as needed on demand, reclaimed as necessary. |
+ LAZY, |
+ // When possible, keep one idle thread on standby, reclaimed as necessary. |
fdoray
2016/11/15 15:27:02
I think it would be clearer if we re-used the *ali
robliao
2016/11/15 15:57:19
Done.
|
+ ONE, |
+ }; |
+ |
// Construct a scheduler worker pool parameter object. |name| will be used to |
// label the pool's threads ("TaskScheduler" + |name| + index) and histograms |
// ("TaskScheduler." + histogram name + "." + |name| + extra suffixes). The |
@@ -33,6 +40,7 @@ class BASE_EXPORT SchedulerWorkerPoolParams final { |
SchedulerWorkerPoolParams(const std::string& name, |
ThreadPriority priority_hint, |
IORestriction io_restriction, |
+ StandbyThreadPolicy standby_thread_policy, |
int max_threads, |
const TimeDelta& suggested_reclaim_time); |
SchedulerWorkerPoolParams(SchedulerWorkerPoolParams&& other); |
@@ -41,6 +49,9 @@ class BASE_EXPORT SchedulerWorkerPoolParams final { |
const std::string& name() const { return name_; } |
ThreadPriority priority_hint() const { return priority_hint_; } |
IORestriction io_restriction() const { return io_restriction_; } |
+ StandbyThreadPolicy standby_thread_policy() const { |
+ return standby_thread_policy_; |
+ } |
size_t max_threads() const { return max_threads_; } |
const TimeDelta& suggested_reclaim_time() const { |
return suggested_reclaim_time_; |
@@ -50,6 +61,7 @@ class BASE_EXPORT SchedulerWorkerPoolParams final { |
std::string name_; |
ThreadPriority priority_hint_; |
IORestriction io_restriction_; |
+ StandbyThreadPolicy standby_thread_policy_; |
size_t max_threads_; |
TimeDelta suggested_reclaim_time_; |