Chromium Code Reviews| 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) |