From c08d931e4c8a3609763530c556f22e0cc51cad4d Mon Sep 17 00:00:00 2001 From: "reveman@chromium.org" Date: Tue, 2 Jul 2013 00:02:57 +0000 Subject: cc: Use background priority for worker threads on Linux. Also does some cleanup of thread priority code by using SimplThread::SetThreadPriority instead of PlatformThread API. BUG=204147 Review URL: https://chromiumcodereview.appspot.com/18309002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209549 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/resources/worker_pool.cc | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/cc/resources/worker_pool.cc b/cc/resources/worker_pool.cc index 44a655d..55b6d4a 100644 --- a/cc/resources/worker_pool.cc +++ b/cc/resources/worker_pool.cc @@ -4,11 +4,6 @@ #include "cc/resources/worker_pool.h" -#if defined(OS_ANDROID) -// TODO(epenner): Move thread priorities to base. (crbug.com/170549) -#include -#endif - #include #include @@ -163,6 +158,9 @@ WorkerPool::Inner::Inner( "Worker%u", static_cast(workers_.size() + 1)).c_str())); worker->Start(); +#if defined(OS_ANDROID) || defined(OS_LINUX) + worker->SetThreadPriority(base::kThreadPriority_Background); +#endif workers_.push_back(worker.Pass()); } } @@ -293,12 +291,6 @@ void WorkerPool::Inner::CollectCompletedTasks(TaskVector* completed_tasks) { } void WorkerPool::Inner::Run() { -#if defined(OS_ANDROID) - base::PlatformThread::SetThreadPriority( - base::PlatformThread::CurrentHandle(), - base::kThreadPriority_Background); -#endif - base::AutoLock lock(lock_); // Get a unique thread index. -- cgit v1.1