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

Side by Side Diff: content/renderer/categorized_worker_pool.cc

Issue 2204333003: Add joinable option to SimpleThread::Options as was just done for Thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b1_nonjoinable_thread
Patch Set: nits:thestig Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/categorized_worker_pool.h" 5 #include "content/renderer/categorized_worker_pool.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 threads_.push_back(std::move(thread)); 143 threads_.push_back(std::move(thread));
144 } 144 }
145 145
146 // Start a single thread for background work. 146 // Start a single thread for background work.
147 std::vector<cc::TaskCategory> background_categories; 147 std::vector<cc::TaskCategory> background_categories;
148 background_categories.push_back(cc::TASK_CATEGORY_BACKGROUND); 148 background_categories.push_back(cc::TASK_CATEGORY_BACKGROUND);
149 149
150 // Use background priority for background thread. 150 // Use background priority for background thread.
151 base::SimpleThread::Options thread_options; 151 base::SimpleThread::Options thread_options;
152 #if !defined(OS_MACOSX) 152 #if !defined(OS_MACOSX)
153 thread_options.set_priority(base::ThreadPriority::BACKGROUND); 153 thread_options.priority = base::ThreadPriority::BACKGROUND;
154 #endif 154 #endif
155 155
156 std::unique_ptr<base::SimpleThread> thread(new CategorizedWorkerPoolThread( 156 std::unique_ptr<base::SimpleThread> thread(new CategorizedWorkerPoolThread(
157 "CompositorTileWorkerBackground", thread_options, this, 157 "CompositorTileWorkerBackground", thread_options, this,
158 background_categories, &has_ready_to_run_background_tasks_cv_)); 158 background_categories, &has_ready_to_run_background_tasks_cv_));
159 thread->Start(); 159 thread->Start();
160 threads_.push_back(std::move(thread)); 160 threads_.push_back(std::move(thread));
161 } 161 }
162 162
163 void CategorizedWorkerPool::Shutdown() { 163 void CategorizedWorkerPool::Shutdown() {
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 420
421 // Overridden from cc::Task: 421 // Overridden from cc::Task:
422 void CategorizedWorkerPool::ClosureTask::RunOnWorkerThread() { 422 void CategorizedWorkerPool::ClosureTask::RunOnWorkerThread() {
423 closure_.Run(); 423 closure_.Run();
424 closure_.Reset(); 424 closure_.Reset();
425 } 425 }
426 426
427 CategorizedWorkerPool::ClosureTask::~ClosureTask() {} 427 CategorizedWorkerPool::ClosureTask::~ClosureTask() {}
428 428
429 } // namespace content 429 } // namespace content
OLDNEW
« base/threading/simple_thread.cc ('K') | « base/threading/thread_restrictions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698