Avi Drissman | e4622aa | 2022-09-08 20:36:06 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors |
Leszek Swirski | 2987cc8 | 2018-11-05 15:19:28 | [diff] [blame] | 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" |
Anthony Vallee-Dubois | 9dbbbda3 | 2022-08-26 01:25:31 | [diff] [blame] | 9 | #include "base/feature_list.h" |
Etienne Pierre-Doray | d6b575b2 | 2018-11-21 19:32:29 | [diff] [blame] | 10 | #include "base/metrics/field_trial_params.h" |
Aditya Keerthi | a41eda5 | 2019-04-01 15:03:25 | [diff] [blame] | 11 | #include "build/build_config.h" |
Leszek Swirski | 2987cc8 | 2018-11-05 15:19:28 | [diff] [blame] | 12 | |
| 13 | namespace base { |
| 14 | |
Xiaohan Wang | bba17e2 | 2022-01-15 17:58:14 | [diff] [blame] | 15 | #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) |
Francois Doray | 7f77731 | 2019-05-16 12:26:31 | [diff] [blame] | 16 | #define HAS_NATIVE_THREAD_POOL() 1 |
| 17 | #else |
| 18 | #define HAS_NATIVE_THREAD_POOL() 0 |
| 19 | #endif |
| 20 | |
| 21 | #if HAS_NATIVE_THREAD_POOL() |
Francois Doray | ee4a553 | 2021-03-30 00:17:17 | [diff] [blame] | 22 | // Under this feature, ThreadPoolImpl will use a foreground ThreadGroup backed |
| 23 | // by a native thread pool implementation. The Windows Thread Pool API and |
Aditya Keerthi | a41eda5 | 2019-04-01 15:03:25 | [diff] [blame] | 24 | // libdispatch are used on Windows and macOS/iOS respectively. |
Daniel Cheng |
|