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

Unified Diff: base/task_scheduler/scheduler_thread_pool_impl.cc

Issue 2044023003: Virtualize The Existence of a Scheduler Worker Thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@detach
Patch Set: CR Feedback gab@ Created 4 years, 6 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_impl.cc
diff --git a/base/task_scheduler/scheduler_thread_pool_impl.cc b/base/task_scheduler/scheduler_thread_pool_impl.cc
index c7e339a0dd68855a238f7260358449dc75571b28..64dda0abc8fc6096eef26ec7a20a76da6eb2850c 100644
--- a/base/task_scheduler/scheduler_thread_pool_impl.cc
+++ b/base/task_scheduler/scheduler_thread_pool_impl.cc
@@ -203,6 +203,7 @@ class SchedulerThreadPoolImpl::SchedulerWorkerThreadDelegateImpl
SchedulerWorkerThread* worker_thread) override;
void ReEnqueueSequence(scoped_refptr<Sequence> sequence) override;
TimeDelta GetSleepTimeout() override;
+ bool CanDetach(SchedulerWorkerThread* worker_thread) override;
private:
SchedulerThreadPoolImpl* outer_;
@@ -485,6 +486,11 @@ TimeDelta SchedulerThreadPoolImpl::SchedulerWorkerThreadDelegateImpl::
return TimeDelta::Max();
}
+bool SchedulerThreadPoolImpl::SchedulerWorkerThreadDelegateImpl::CanDetach(
+ SchedulerWorkerThread* worker_thread) {
+ return false;
+}
+
SchedulerThreadPoolImpl::SchedulerThreadPoolImpl(
StringPiece name,
IORestriction io_restriction,
@@ -521,7 +527,8 @@ bool SchedulerThreadPoolImpl::Initialize(
thread_priority, WrapUnique(new SchedulerWorkerThreadDelegateImpl(
this, re_enqueue_sequence_callback,
&shared_priority_queue_, static_cast<int>(i))),
- task_tracker_);
+ task_tracker_,
+ SchedulerWorkerThread::InitialState::ALIVE);
if (!worker_thread)
break;
idle_worker_threads_stack_.Push(worker_thread.get());

Powered by Google App Engine
This is Rietveld 408576698