Lines Matching refs:ThreadId
14 class ThreadId {
16 // Creates an invalid ThreadId.
17 constexpr ThreadId() noexcept : ThreadId(kInvalidId) {}
19 bool operator==(const ThreadId& other) const { return id_ == other.id_; }
20 bool operator!=(const ThreadId& other) const { return id_ != other.id_; }
22 // Checks whether this ThreadId refers to any thread.
25 // Converts ThreadId to an integer representation.
28 // Returns ThreadId for current thread if it exists or invalid id.
29 static ThreadId TryGetCurrent();
31 // Returns ThreadId for current thread.
32 static ThreadId Current() { return ThreadId(GetCurrentThreadId()); }
34 // Returns invalid ThreadId (guaranteed not to be equal to any thread).
35 static constexpr ThreadId Invalid() { return ThreadId(kInvalidId); }
37 // Converts ThreadId to an integer representation
39 static constexpr ThreadId FromInteger(int id) { return ThreadId(id); }
44 explicit constexpr ThreadId(int id) noexcept : id_(id) {}