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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 : handle_(handle), | 82 : handle_(handle), |
83 id_(0) { | 83 id_(0) { |
84 } | 84 } |
85 | 85 |
86 PlatformThreadHandle(Handle handle, | 86 PlatformThreadHandle(Handle handle, |
87 PlatformThreadId id) | 87 PlatformThreadId id) |
88 : handle_(handle), | 88 : handle_(handle), |
89 id_(id) { | 89 id_(id) { |
90 } | 90 } |
91 | 91 |
| 92 PlatformThreadId id() const { |
| 93 return id_; |
| 94 } |
| 95 |
92 bool is_equal(const PlatformThreadHandle& other) const { | 96 bool is_equal(const PlatformThreadHandle& other) const { |
93 return handle_ == other.handle_; | 97 return handle_ == other.handle_; |
94 } | 98 } |
95 | 99 |
96 bool is_null() const { | 100 bool is_null() const { |
97 return !handle_; | 101 return !handle_; |
98 } | 102 } |
99 | 103 |
100 Handle platform_handle() const { | 104 Handle platform_handle() const { |
101 return handle_; | 105 return handle_; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 static void SetThreadPriority(PlatformThreadHandle handle, | 195 static void SetThreadPriority(PlatformThreadHandle handle, |
192 ThreadPriority priority); | 196 ThreadPriority priority); |
193 | 197 |
194 private: | 198 private: |
195 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread); | 199 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformThread); |
196 }; | 200 }; |
197 | 201 |
198 } // namespace base | 202 } // namespace base |
199 | 203 |
200 #endif // BASE_THREADING_PLATFORM_THREAD_H_ | 204 #endif // BASE_THREADING_PLATFORM_THREAD_H_ |
OLD | NEW |