xref: /aosp_15_r20/external/cronet/base/task/single_thread_task_runner_thread_mode.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2016 The Chromium Authors
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_SINGLE_THREAD_TASK_RUNNER_THREAD_MODE_H_
6 #define BASE_TASK_SINGLE_THREAD_TASK_RUNNER_THREAD_MODE_H_
7 
8 namespace base {
9 
10 enum class SingleThreadTaskRunnerThreadMode {
11   // Allow the SingleThreadTaskRunner's thread to be shared with others,
12   // allowing for efficient use of thread resources when this
13   // SingleThreadTaskRunner is idle. This is the default mode and is
14   // recommended for thread-affine code.
15   SHARED,
16   // Create a new thread, dedicated to this SingleThreadTaskRunner, and tear it
17   // down when the last reference to the TaskRunner is dropped.
18   DEDICATED,
19 };
20 
21 }  // namespace base
22 
23 #endif  // BASE_TASK_SINGLE_THREAD_TASK_RUNNER_THREAD_MODE_H_
24