OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // WARNING: You should *NOT* be using this class directly. PlatformThread is | 5 // WARNING: You should *NOT* be using this class directly. PlatformThread is |
6 // the low-level platform-specific abstraction to the OS's threading interface. | 6 // the low-level platform-specific abstraction to the OS's threading interface. |
7 // You should instead be using a message-loop driven Thread, see thread.h. | 7 // You should instead be using a message-loop driven Thread, see thread.h. |
8 | 8 |
9 #ifndef BASE_THREADING_PLATFORM_THREAD_H_ | 9 #ifndef BASE_THREADING_PLATFORM_THREAD_H_ |
10 #define BASE_THREADING_PLATFORM_THREAD_H_ | 10 #define BASE_THREADING_PLATFORM_THREAD_H_ |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
198 // to raise its priority back up after lowering it if the process does not | 198 // to raise its priority back up after lowering it if the process does not |
199 // have a proper permission, e.g. CAP_SYS_NICE on Linux. A thread may not be | 199 // have a proper permission, e.g. CAP_SYS_NICE on Linux. A thread may not be |
200 // able to lower its priority back down after raising it to REALTIME_AUDIO. | 200 // able to lower its priority back down after raising it to REALTIME_AUDIO. |
201 // Since changing other threads' priority is not permitted in favor of | 201 // Since changing other threads' priority is not permitted in favor of |
202 // security, this interface is restricted to change only the current thread | 202 // security, this interface is restricted to change only the current thread |
203 // priority (https://crbug.com/399473). | 203 // priority (https://crbug.com/399473). |
204 static void SetCurrentThreadPriority(ThreadPriority priority); | 204 static void SetCurrentThreadPriority(ThreadPriority priority); |
205 | 205 |
206 static ThreadPriority GetCurrentThreadPriority(); | 206 static ThreadPriority GetCurrentThreadPriority(); |
207 | 207 |
208 #if defined(OS_LINUX) | |
209 // Warning: Don't use this for a main thread because that will change the | |
210 // whole thread group's (i.e. process) priority. | |
Nico
2016/09/19 20:49:30
Maybe add some words on how this compares to the p
reveman
2016/09/19 21:43:39
Done.
| |
211 static void SetThreadPriority(PlatformThreadId thread_id, | |
212 ThreadPriority priority); | |
213 #endif | |
214 | |
208 private: | 215 private: |
209 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread); | 216 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread); |
210 }; | 217 }; |
211 | 218 |
212 } // namespace base | 219 } // namespace base |
213 | 220 |
214 #endif // BASE_THREADING_PLATFORM_THREAD_H_ | 221 #endif // BASE_THREADING_PLATFORM_THREAD_H_ |
OLD | NEW |