OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef BASE_THREADING_PLATFORM_THREAD_INTERNAL_POSIX_H_ | 5 #ifndef BASE_THREADING_PLATFORM_THREAD_INTERNAL_POSIX_H_ |
6 #define BASE_THREADING_PLATFORM_THREAD_INTERNAL_POSIX_H_ | 6 #define BASE_THREADING_PLATFORM_THREAD_INTERNAL_POSIX_H_ |
7 | 7 |
8 #include "base/threading/platform_thread.h" | 8 #include "base/threading/platform_thread.h" |
9 | 9 |
10 namespace base { | 10 namespace base { |
11 | 11 |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 struct ThreadPriorityToNiceValuePair { | 14 struct ThreadPriorityToNiceValuePair { |
15 ThreadPriority priority; | 15 ThreadPriority priority; |
16 int nice_value; | 16 int nice_value; |
17 }; | 17 }; |
18 extern const ThreadPriorityToNiceValuePair kThreadPriorityToNiceValueMap[4]; | 18 extern const ThreadPriorityToNiceValuePair kThreadPriorityToNiceValueMap[4]; |
19 | 19 |
20 // Returns the nice value matching |priority| based on the platform-specific | 20 // Returns the nice value matching |priority| based on the platform-specific |
21 // implementation of kThreadPriorityToNiceValueMap. | 21 // implementation of kThreadPriorityToNiceValueMap. |
22 int ThreadPriorityToNiceValue(ThreadPriority priority); | 22 int ThreadPriorityToNiceValue(ThreadPriority priority); |
23 | 23 |
24 // Returns the ThreadPrioirty matching |nice_value| based on the platform- | |
25 // specific implementation of kThreadPriorityToNiceValueMap. | |
26 ThreadPriority NiceValueToThreadPriority(int nice_value); | |
27 | |
24 // Allows platform specific tweaks to the generic POSIX solution for | 28 // Allows platform specific tweaks to the generic POSIX solution for |
25 // SetThreadPriority. Returns true if the platform-specific implementation | 29 // SetThreadPriority. Returns true if the platform-specific implementation |
26 // handled this |priority| change, false if the generic implementation should | 30 // handled this |priority| change, false if the generic implementation should |
27 // instead proceed. | 31 // instead proceed. |
28 bool HandleSetThreadPriorityForPlatform(PlatformThreadHandle handle, | 32 bool HandleSetThreadPriorityForPlatform(PlatformThreadHandle handle, |
29 ThreadPriority priority); | 33 ThreadPriority priority); |
30 | 34 |
35 // Mirrors HandleSetThreadPriorityForPlatform(). Returns true if there is a | |
rvargas (doing something else)
2015/03/19 22:19:21
I think we should remove the first sentence. Just
gab
2015/03/30 20:14:45
Done.
| |
36 // platform-specific ThreadPriority set on |handle| (and returns the actual | |
37 // ThreadPriority via |priority|). Returns false otherwise, leaving |priority| | |
38 // untouched. | |
39 bool HandleGetThreadPriorityForPlatform(PlatformThreadHandle handle, | |
rvargas (doing something else)
2015/03/19 22:19:21
I know I just said that this was ok, but reading t
gab
2015/03/30 20:14:45
Done.
| |
40 ThreadPriority* priority); | |
41 | |
31 } // namespace internal | 42 } // namespace internal |
32 | 43 |
33 } // namespace base | 44 } // namespace base |
34 | 45 |
35 #endif // BASE_THREADING_PLATFORM_THREAD_INTERNAL_POSIX_H_ | 46 #endif // BASE_THREADING_PLATFORM_THREAD_INTERNAL_POSIX_H_ |
OLD | NEW |