| 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..b17c34d43d5ccaf92275616147976156b62b6567 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,13 @@ 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.
|
| + // TODO(epenner): Move thread priorities to base. (crbug.com/170549)
|
| + if (setpriority(PRIO_PROCESS, PlatformThread::CurrentId(), 0))
|
| + DVLOG(1) << "Failed to reset initial thread nice value to zero.";
|
| +#endif
|
| ThreadParams* thread_params = static_cast<ThreadParams*>(params);
|
| PlatformThread::Delegate* delegate = thread_params->delegate;
|
| if (!thread_params->joinable)
|
|
|