diff options
author | reveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-02 00:02:57 +0000 |
---|---|---|
committer | reveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-02 00:02:57 +0000 |
commit | c08d931e4c8a3609763530c556f22e0cc51cad4d (patch) | |
tree | a97bfb36913280a252398f58a43330846f8b2621 /cc/resources/worker_pool.cc | |
parent | 87ffb63e371ad33f541292c05b034a6e5335d89e (diff) | |
download | chromium_src-c08d931e4c8a3609763530c556f22e0cc51cad4d.zip chromium_src-c08d931e4c8a3609763530c556f22e0cc51cad4d.tar.gz chromium_src-c08d931e4c8a3609763530c556f22e0cc51cad4d.tar.bz2 |
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
Diffstat (limited to 'cc/resources/worker_pool.cc')
-rw-r--r-- | cc/resources/worker_pool.cc | 14 |
1 files 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 <sys/resource.h> -#endif - #include <algorithm> #include <queue> @@ -163,6 +158,9 @@ WorkerPool::Inner::Inner( "Worker%u", static_cast<unsigned>(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. |