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

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: rebase 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
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 a6ee6bad9074fe14e9d6f99080776d64bf517961..203877d6dc4fe938d23c41cea86d4860cae2f036 100644
--- a/base/task_scheduler/scheduler_thread_pool.cc
+++ b/base/task_scheduler/scheduler_thread_pool.cc
@@ -131,8 +131,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* alternate_priority_queue,
+ bool* alternate_priority_queue_used) override;
void EnqueueSequence(scoped_refptr<Sequence> sequence) override;
private:
@@ -247,7 +248,12 @@ void SchedulerThreadPool::SchedulerWorkerThreadDelegateImpl::OnMainEntry() {
scoped_refptr<Sequence>
SchedulerThreadPool::SchedulerWorkerThreadDelegateImpl::GetWork(
- SchedulerWorkerThread* worker_thread) {
+ SchedulerWorkerThread* worker_thread,
+ PriorityQueue* alternate_priority_queue,
danakj 2016/04/20 23:16:16 I would not add these arguments until you're going
fdoray 2016/04/21 19:31:28 n/a with the latest patch set
+ bool* alternate_priority_queue_used) {
+ // TODO(fdoray): Return a Sequence from |alternate_priority_queue| when
+ // appropriate.
+
std::unique_ptr<PriorityQueue::Transaction> transaction(
outer_->shared_priority_queue_.BeginTransaction());
const auto& sequence_and_sort_key = transaction->Peek();
@@ -305,7 +311,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') | base/task_scheduler/scheduler_worker_thread.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698