Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1061)

Unified Diff: base/threading/sequenced_worker_pool.h

Issue 2330303003: Disallow single-threaded SequencedWorkerPools. (Closed)
Patch Set: merge up to r419443 Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/threading/sequenced_worker_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/sequenced_worker_pool.h
diff --git a/base/threading/sequenced_worker_pool.h b/base/threading/sequenced_worker_pool.h
index c150983e0bd5d0d49dac186652c0fd13988f3d3f..722380e8061b6495cbf37ebb98a16cd39ca38a90 100644
--- a/base/threading/sequenced_worker_pool.h
+++ b/base/threading/sequenced_worker_pool.h
@@ -180,8 +180,6 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner {
// Ideally, call this on the main thread of a process, before any other
// threads are created and before any tasks are posted to that process'
// SequencedWorkerPools.
- // Note: SequencedWorkerPool instances with |max_threads == 1| will be special
- // cased to send all of their work as ExecutionMode::SINGLE_THREADED.
// TODO(gab): Remove this if http://crbug.com/622400 fails
// (SequencedWorkerPool will be phased out completely otherwise).
static void RedirectToTaskSchedulerForProcess();
@@ -198,11 +196,12 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner {
// ThreadTaskRunnerHandle on the current thread unless you plan to
// deliberately leak it.
- // Pass the maximum number of threads (they will be lazily created as needed)
- // and a prefix for the thread name to aid in debugging. |task_priority| will
- // be used to hint base::TaskScheduler for an experiment in which all
- // SequencedWorkerPool tasks will be redirected to it in processes where a
- // base::TaskScheduler was instantiated.
+ // Constructs a SequencedWorkerPool which will lazily create up to
+ // |max_threads| and a prefix for the thread name to aid in debugging.
+ // |max_threads| must be greater than 1. |task_priority| will be used to hint
+ // base::TaskScheduler for an experiment in which all SequencedWorkerPool
+ // tasks will be redirected to it in processes where a base::TaskScheduler was
+ // instantiated.
SequencedWorkerPool(size_t max_threads,
const std::string& thread_name_prefix,
base::TaskPriority task_priority);
« no previous file with comments | « no previous file | base/threading/sequenced_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698