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

Unified Diff: base/threading/sequenced_worker_pool.cc

Issue 2590443005: Add TaskTraits::MayBlock and TaskTraits::WithSyncPrimitives. (Closed)
Patch Set: CR Created 4 years 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 | « base/task_scheduler/task_traits.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/sequenced_worker_pool.cc
diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc
index 56bbb62dd09f58bb92f05340598a109e715c5aee..91ae69b5dbff0fa85f56b6ff59c778185148500d 100644
--- a/base/threading/sequenced_worker_pool.cc
+++ b/base/threading/sequenced_worker_pool.cc
@@ -812,8 +812,8 @@ bool SequencedWorkerPool::Inner::PostTaskToTaskScheduler(
const TaskShutdownBehavior task_shutdown_behavior =
static_cast<TaskShutdownBehavior>(sequenced.shutdown_behavior);
const TaskTraits traits = TaskTraits()
- .WithFileIO()
- .WithWait()
+ .MayBlock()
+ .WithSyncPrimitives()
.WithPriority(task_priority_)
.WithShutdownBehavior(task_shutdown_behavior);
return GetTaskSchedulerTaskRunner(sequenced.sequence_token_id, traits)
@@ -864,7 +864,8 @@ bool SequencedWorkerPool::Inner::RunsTasksOnCurrentThread() const {
if (g_all_pools_state == AllPoolsState::REDIRECTED_TO_TASK_SCHEDULER) {
if (!runs_tasks_on_verifier_) {
runs_tasks_on_verifier_ = CreateTaskRunnerWithTraits(
- TaskTraits().WithFileIO().WithWait().WithPriority(task_priority_));
+ TaskTraits().MayBlock().WithSyncPrimitives().WithPriority(
+ task_priority_));
}
return runs_tasks_on_verifier_->RunsTasksOnCurrentThread();
} else {
« no previous file with comments | « base/task_scheduler/task_traits.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698