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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 52 } |
53 | 53 |
54 explicit PlatformThreadRef(RefType id) | 54 explicit PlatformThreadRef(RefType id) |
55 : id_(id) { | 55 : id_(id) { |
56 } | 56 } |
57 | 57 |
58 bool operator==(PlatformThreadRef other) const { | 58 bool operator==(PlatformThreadRef other) const { |
59 return id_ == other.id_; | 59 return id_ == other.id_; |
60 } | 60 } |
61 | 61 |
| 62 bool operator!=(PlatformThreadRef other) const { return id_ != other.id_; } |
| 63 |
62 bool is_null() const { | 64 bool is_null() const { |
63 return id_ == 0; | 65 return id_ == 0; |
64 } | 66 } |
65 private: | 67 private: |
66 RefType id_; | 68 RefType id_; |
67 }; | 69 }; |
68 | 70 |
69 // Used to operate on threads. | 71 // Used to operate on threads. |
70 class PlatformThreadHandle { | 72 class PlatformThreadHandle { |
71 public: | 73 public: |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 ThreadPriority priority); | 221 ThreadPriority priority); |
220 #endif | 222 #endif |
221 | 223 |
222 private: | 224 private: |
223 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread); | 225 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread); |
224 }; | 226 }; |
225 | 227 |
226 } // namespace base | 228 } // namespace base |
227 | 229 |
228 #endif // BASE_THREADING_PLATFORM_THREAD_H_ | 230 #endif // BASE_THREADING_PLATFORM_THREAD_H_ |
OLD | NEW |