Used to operate on threads.
| 66 | |
| 67 | // Used to operate on threads. |
| 68 | class PlatformThreadHandle { |
| 69 | public: |
| 70 | #if defined(OS_WIN) |
| 71 | typedef void* Handle; |
| 72 | #elif defined(OS_POSIX) |
| 73 | typedef pthread_t Handle; |
| 74 | #endif |
| 75 | |
| 76 | PlatformThreadHandle() |
| 77 | : handle_(0), |
| 78 | id_(0) { |
| 79 | } |
| 80 | |
| 81 | explicit PlatformThreadHandle(Handle handle) |
| 82 | : handle_(handle), |
| 83 | id_(0) { |
| 84 | } |
| 85 | |
| 86 | PlatformThreadHandle(Handle handle, |
| 87 | PlatformThreadId id) |
| 88 | : handle_(handle), |
| 89 | id_(id) { |
| 90 | } |
| 91 | |
| 92 | bool is_equal(const PlatformThreadHandle& other) const { |
| 93 | return handle_ == other.handle_; |
| 94 | } |
| 95 | |
| 96 | bool is_null() const { |
| 97 | return !handle_; |
| 98 | } |
| 99 | |
| 100 | Handle platform_handle() const { |
| 101 | return handle_; |
| 102 | } |
| 103 | |
| 104 | private: |
| 105 | friend class PlatformThread; |
| 106 | |
| 107 | Handle handle_; |
| 108 | PlatformThreadId id_; |
| 109 | }; |
| 110 | |
| 111 | const PlatformThreadId kInvalidThreadId(0); |
| 112 |
no outgoing calls
no test coverage detected