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

Unified Diff: base/task_scheduler/scheduler_thread_pool.cc

Issue 1876363004: TaskScheduler [11] Support ExecutionMode::SINGLE_THREADED. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@8_delayed
Patch Set: self review Created 4 years, 8 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/task_scheduler/scheduler_worker_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/scheduler_thread_pool.cc
diff --git a/base/task_scheduler/scheduler_thread_pool.cc b/base/task_scheduler/scheduler_thread_pool.cc
index 1ac547f5cb6cf13243fde345bef1d8cb6fa693bc..8a8d3819b308181c17abd744e4ab92ea9c3debcf 100644
--- a/base/task_scheduler/scheduler_thread_pool.cc
+++ b/base/task_scheduler/scheduler_thread_pool.cc
@@ -125,8 +125,9 @@ class SchedulerThreadPool::SchedulerWorkerThreadDelegateImpl
// SchedulerWorkerThread::Delegate:
void OnMainEntry() override;
- scoped_refptr<Sequence> GetWork(
- SchedulerWorkerThread* worker_thread) override;
+ scoped_refptr<Sequence> GetWork(SchedulerWorkerThread* worker_thread,
+ PriorityQueue* single_threaded_priority_queue,
robliao 2016/04/18 19:53:51 single_thread_priority_queue -> alternate_priority
fdoray 2016/04/18 20:40:55 Done.
+ bool* is_single_threaded_sequence) override;
void EnqueueSequence(scoped_refptr<Sequence> sequence) override;
private:
@@ -241,7 +242,12 @@ void SchedulerThreadPool::SchedulerWorkerThreadDelegateImpl::OnMainEntry() {
scoped_refptr<Sequence>
SchedulerThreadPool::SchedulerWorkerThreadDelegateImpl::GetWork(
- SchedulerWorkerThread* worker_thread) {
+ SchedulerWorkerThread* worker_thread,
+ PriorityQueue* single_threaded_priority_queue,
+ bool* is_single_threaded_sequence) {
+ // TODO(fdoray): Return a Sequence from |single_threaded_priority_queue| when
+ // appropriate.
+
std::unique_ptr<PriorityQueue::Transaction> transaction(
outer_->shared_priority_queue_.BeginTransaction());
const auto sequence_and_sort_key = transaction->Peek();
@@ -298,7 +304,8 @@ bool SchedulerThreadPool::Initialize(ThreadPriority thread_priority,
for (size_t i = 0; i < max_threads; ++i) {
std::unique_ptr<SchedulerWorkerThread> worker_thread =
SchedulerWorkerThread::CreateSchedulerWorkerThread(
- thread_priority, worker_thread_delegate_.get(), task_tracker_);
+ thread_priority, worker_thread_delegate_.get(), task_tracker_,
+ delayed_task_manager_, &shared_priority_queue_);
if (!worker_thread)
break;
idle_worker_threads_stack_.push(worker_thread.get());
« no previous file with comments | « no previous file | base/task_scheduler/scheduler_worker_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698