single_thread_task_runner_thread_mode.h 849 B

1234567891011121314151617181920212223
  1. // Copyright 2016 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. #ifndef BASE_TASK_SINGLE_THREAD_TASK_RUNNER_THREAD_MODE_H_
  5. #define BASE_TASK_SINGLE_THREAD_TASK_RUNNER_THREAD_MODE_H_
  6. namespace base {
  7. enum class SingleThreadTaskRunnerThreadMode {
  8. // Allow the SingleThreadTaskRunner's thread to be shared with others,
  9. // allowing for efficient use of thread resources when this
  10. // SingleThreadTaskRunner is idle. This is the default mode and is
  11. // recommended for thread-affine code.
  12. SHARED,
  13. // Create a new thread, dedicated to this SingleThreadTaskRunner, and tear it
  14. // down when the last reference to the TaskRunner is dropped.
  15. DEDICATED,
  16. };
  17. } // namespace base
  18. #endif // BASE_TASK_SINGLE_THREAD_TASK_RUNNER_THREAD_MODE_H_