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

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: fix TSan and ASan 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
« no previous file with comments | « base/threading/simple_thread_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 threads_.push_back(std::move(thread)); 145 threads_.push_back(std::move(thread));
146 } 146 }
147 147
148 // Start a single thread for background work. 148 // Start a single thread for background work.
149 std::vector<cc::TaskCategory> background_categories; 149 std::vector<cc::TaskCategory> background_categories;
150 background_categories.push_back(cc::TASK_CATEGORY_BACKGROUND); 150 background_categories.push_back(cc::TASK_CATEGORY_BACKGROUND);
151 151
152 // Use background priority for background thread. 152 // Use background priority for background thread.
153 base::SimpleThread::Options thread_options; 153 base::SimpleThread::Options thread_options;
154 #if !defined(OS_MACOSX) 154 #if !defined(OS_MACOSX)
155 thread_options.set_priority(base::ThreadPriority::BACKGROUND); 155 thread_options.priority = base::ThreadPriority::BACKGROUND;
156 #endif 156 #endif
157 157
158 std::unique_ptr<base::SimpleThread> thread(new CategorizedWorkerPoolThread( 158 std::unique_ptr<base::SimpleThread> thread(new CategorizedWorkerPoolThread(
159 "CompositorTileWorkerBackground", thread_options, this, 159 "CompositorTileWorkerBackground", thread_options, this,
160 background_categories, &has_ready_to_run_background_tasks_cv_)); 160 background_categories, &has_ready_to_run_background_tasks_cv_));
161 thread->Start(); 161 thread->Start();
162 threads_.push_back(std::move(thread)); 162 threads_.push_back(std::move(thread));
163 } 163 }
164 164
165 void CategorizedWorkerPool::Shutdown() { 165 void CategorizedWorkerPool::Shutdown() {
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 422
423 // Overridden from cc::Task: 423 // Overridden from cc::Task:
424 void CategorizedWorkerPool::ClosureTask::RunOnWorkerThread() { 424 void CategorizedWorkerPool::ClosureTask::RunOnWorkerThread() {
425 closure_.Run(); 425 closure_.Run();
426 closure_.Reset(); 426 closure_.Reset();
427 } 427 }
428 428
429 CategorizedWorkerPool::ClosureTask::~ClosureTask() {} 429 CategorizedWorkerPool::ClosureTask::~ClosureTask() {}
430 430
431 } // namespace content 431 } // namespace content
OLDNEW
« no previous file with comments | « base/threading/simple_thread_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698