Leszek Swirski | 2987cc8 | 2018-11-05 15:19:28 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef BASE_TASK_TASK_FEATURES_H_ |
| 6 | #define BASE_TASK_TASK_FEATURES_H_ |
| 7 | |
| 8 | #include "base/base_export.h" |
Etienne Pierre-Doray | d6b575b2 | 2018-11-21 19:32:29 | [diff] [blame] | 9 | #include "base/metrics/field_trial_params.h" |
Aditya Keerthi | a41eda5 | 2019-04-01 15:03:25 | [diff] [blame] | 10 | #include "build/build_config.h" |
Leszek Swirski | 2987cc8 | 2018-11-05 15:19:28 | [diff] [blame] | 11 | |
| 12 | namespace base { |
| 13 | |
| 14 | struct Feature; |
Francois Doray | 5b44e33f | 2018-11-09 22:08:13 | [diff] [blame] | 15 | |
| 16 | extern const BASE_EXPORT Feature kAllTasksUserBlocking; |
| 17 | extern const BASE_EXPORT Feature kMergeBlockingNonBlockingPools; |
Etienne Pierre-Doray | d6b575b2 | 2018-11-21 19:32:29 | [diff] [blame] | 18 | |
Gabriel Charette | 3e2898f | 2019-05-01 14:55:01 | [diff] [blame^] | 19 | // Under this feature, unused threads in ThreadGroup are only detached |
Etienne Pierre-Doray | f9ef218 | 2018-12-13 14:45:42 | [diff] [blame] | 20 | // if the total number of threads in the pool is above the initial capacity. |
| 21 | extern const BASE_EXPORT Feature kNoDetachBelowInitialCapacity; |
| 22 | |
Etienne Pierre-doray | 3ed4138 | 2019-02-06 04:40:47 | [diff] [blame] | 23 | // Under this feature, workers blocked with MayBlock are replaced immediately |
| 24 | // instead of waiting for a threshold. |
| 25 | extern const BASE_EXPORT Feature kMayBlockWithoutDelay; |
| 26 | |
Aditya Keerthi | a41eda5 | 2019-04-01 15:03:25 | [diff] [blame] | 27 | #if defined(OS_WIN) || defined(OS_MACOSX) |
Gabriel Charette | 3e2898f | 2019-05-01 14:55:01 | [diff] [blame^] | 28 | // Under this feature, ThreadPool will use a ThreadGroup backed by a |
Aditya Keerthi | a41eda5 | 2019-04-01 15:03:25 | [diff] [blame] | 29 | // native thread pool implementation. The Windows Thread Pool API and |
| 30 | // libdispatch are used on Windows and macOS/iOS respectively. |
| 31 | extern const BASE_EXPORT Feature kUseNativeThreadPool; |
| 32 | #endif |
| 33 | |
Leszek Swirski | 2987cc8 | 2018-11-05 15:19:28 | [diff] [blame] | 34 | } // namespace base |
| 35 | |
| 36 | #endif // BASE_TASK_TASK_FEATURES_H_ |