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