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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // Suitable for threads that shouldn't disrupt high priority work. | 103 // Suitable for threads that shouldn't disrupt high priority work. |
104 BACKGROUND, | 104 BACKGROUND, |
105 // Default priority level. | 105 // Default priority level. |
106 NORMAL, | 106 NORMAL, |
107 // Suitable for threads which generate data for the display (at ~60Hz). | 107 // Suitable for threads which generate data for the display (at ~60Hz). |
108 DISPLAY, | 108 DISPLAY, |
109 // Suitable for low-latency, glitch-resistant audio. | 109 // Suitable for low-latency, glitch-resistant audio. |
110 REALTIME_AUDIO, | 110 REALTIME_AUDIO, |
111 }; | 111 }; |
112 | 112 |
| 113 std::string BASE_EXPORT GetThreadPriorityAbbr(ThreadPriority priority); |
| 114 |
113 // A namespace for low-level thread functions. | 115 // A namespace for low-level thread functions. |
114 class BASE_EXPORT PlatformThread { | 116 class BASE_EXPORT PlatformThread { |
115 public: | 117 public: |
116 // Implement this interface to run code on a background thread. Your | 118 // Implement this interface to run code on a background thread. Your |
117 // ThreadMain method will be called on the newly created thread. | 119 // ThreadMain method will be called on the newly created thread. |
118 class BASE_EXPORT Delegate { | 120 class BASE_EXPORT Delegate { |
119 public: | 121 public: |
120 virtual void ThreadMain() = 0; | 122 virtual void ThreadMain() = 0; |
121 | 123 |
122 protected: | 124 protected: |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 193 |
192 static ThreadPriority GetCurrentThreadPriority(); | 194 static ThreadPriority GetCurrentThreadPriority(); |
193 | 195 |
194 private: | 196 private: |
195 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread); | 197 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread); |
196 }; | 198 }; |
197 | 199 |
198 } // namespace base | 200 } // namespace base |
199 | 201 |
200 #endif // BASE_THREADING_PLATFORM_THREAD_H_ | 202 #endif // BASE_THREADING_PLATFORM_THREAD_H_ |
OLD | NEW |