Index: base/threading/platform_thread_android.cc |
diff --git a/base/threading/platform_thread_android.cc b/base/threading/platform_thread_android.cc |
index bd0b4b33db74a137fa1dd0508f39586362857d5a..87a1c5d16195b50f88867385ce8d3dcde7ace669 100644 |
--- a/base/threading/platform_thread_android.cc |
+++ b/base/threading/platform_thread_android.cc |
@@ -65,13 +65,13 @@ void PlatformThread::SetThreadPriority(PlatformThreadHandle handle, |
return; |
} |
- // setpriority(2) will set a thread's priority if it is passed a tid as |
- // the 'process identifier', not affecting the rest of the threads in the |
- // process. Setting this priority will only succeed if the user has been |
- // granted permission to adjust nice values on the system. |
+ // setpriority(2) should change the whole thread group's (i.e. process) |
+ // priority. However, on Linux it will only change the current thread. See |
+ // the BUGs section in |
+ // http://man7.org/linux/man-pages/man2/getpriority.2.html. |
DCHECK_NE(handle.id_, kInvalidThreadId); |
int kNiceSetting = ThreadNiceValue(priority); |
- if (setpriority(PRIO_PROCESS, handle.id_, kNiceSetting)) |
+ if (setpriority(PRIO_PROCESS, 0, kNiceSetting)) |
mdempsky
2014/08/01 00:05:32
Can SetThreadPriority() be called by a different t
jln (very slow on Chromium)
2014/08/01 00:39:53
Ooch. I was a little hasty on this one indeed, tha
|
LOG(ERROR) << "Failed to set nice value of thread to " << kNiceSetting; |
} |