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

Unified Diff: base/threading/platform_thread_posix.cc

Issue 11880014: cc: Set ui/gpu/cc/ipc/upload/raster thread priorities. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase. Address feedback. Created 7 years, 11 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
« no previous file with comments | « no previous file | cc/raster_worker_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/platform_thread_posix.cc
diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc
index 444edc58a6268649115f2f1583bc7b56374d961d..e12692c47e75fb353c7db84b309857452ac6fc85 100644
--- a/base/threading/platform_thread_posix.cc
+++ b/base/threading/platform_thread_posix.cc
@@ -29,6 +29,7 @@
#endif
#if defined(OS_ANDROID)
+#include <sys/resource.h>
#include "base/android/jni_android.h"
#endif
@@ -57,6 +58,11 @@ struct ThreadParams {
};
void* ThreadFunc(void* params) {
+#if defined(OS_ANDROID)
+ // Threads on linux/android may inherit their priority from the thread
+ // where they were created. This sets all threads to the default.
+ setpriority(PRIO_PROCESS, base::PlatformThread::CurrentId(), 0);
jar (doing other things) 2013/01/23 02:37:37 nit: how about checking the return value, at least
+#endif
ThreadParams* thread_params = static_cast<ThreadParams*>(params);
PlatformThread::Delegate* delegate = thread_params->delegate;
if (!thread_params->joinable)
« no previous file with comments | « no previous file | cc/raster_worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698