| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // the thread is set based on |priority|. | 168 // the thread is set based on |priority|. |
| 169 static bool CreateWithPriority(size_t stack_size, Delegate* delegate, | 169 static bool CreateWithPriority(size_t stack_size, Delegate* delegate, |
| 170 PlatformThreadHandle* thread_handle, | 170 PlatformThreadHandle* thread_handle, |
| 171 ThreadPriority priority); | 171 ThreadPriority priority); |
| 172 | 172 |
| 173 // CreateNonJoinable() does the same thing as Create() except the thread | 173 // CreateNonJoinable() does the same thing as Create() except the thread |
| 174 // cannot be Join()'d. Therefore, it also does not output a | 174 // cannot be Join()'d. Therefore, it also does not output a |
| 175 // PlatformThreadHandle. | 175 // PlatformThreadHandle. |
| 176 static bool CreateNonJoinable(size_t stack_size, Delegate* delegate); | 176 static bool CreateNonJoinable(size_t stack_size, Delegate* delegate); |
| 177 | 177 |
| 178 // CreateNonJoinableWithPriority() does the same thing as CreateNonJoinable() |
| 179 // except the priority of the thread is set based on |priority|. |
| 180 static bool CreateNonJoinableWithPriority(size_t stack_size, |
| 181 Delegate* delegate, |
| 182 ThreadPriority priority); |
| 183 |
| 178 // Joins with a thread created via the Create function. This function blocks | 184 // Joins with a thread created via the Create function. This function blocks |
| 179 // the caller until the designated thread exits. This will invalidate | 185 // the caller until the designated thread exits. This will invalidate |
| 180 // |thread_handle|. | 186 // |thread_handle|. |
| 181 static void Join(PlatformThreadHandle thread_handle); | 187 static void Join(PlatformThreadHandle thread_handle); |
| 182 | 188 |
| 183 // Detaches and releases the thread handle. The thread is no longer joinable | 189 // Detaches and releases the thread handle. The thread is no longer joinable |
| 184 // and |thread_handle| is invalidated after this call. | 190 // and |thread_handle| is invalidated after this call. |
| 185 static void Detach(PlatformThreadHandle thread_handle); | 191 static void Detach(PlatformThreadHandle thread_handle); |
| 186 | 192 |
| 187 // Returns true if SetCurrentThreadPriority() can be used to increase the | 193 // Returns true if SetCurrentThreadPriority() can be used to increase the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 199 | 205 |
| 200 static ThreadPriority GetCurrentThreadPriority(); | 206 static ThreadPriority GetCurrentThreadPriority(); |
| 201 | 207 |
| 202 private: | 208 private: |
| 203 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread); | 209 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread); |
| 204 }; | 210 }; |
| 205 | 211 |
| 206 } // namespace base | 212 } // namespace base |
| 207 | 213 |
| 208 #endif // BASE_THREADING_PLATFORM_THREAD_H_ | 214 #endif // BASE_THREADING_PLATFORM_THREAD_H_ |
| OLD | NEW |