Expose native thread id
This commit is contained in:
parent
3cd748a234
commit
e7def962f3
|
@ -343,6 +343,9 @@ class Thread : public WaitHandle {
|
|||
// threads that had been waiting for the thread to terminate.
|
||||
static void Exit(int exit_code);
|
||||
|
||||
// Returns the ID of the thread
|
||||
virtual uint32_t id() const = 0;
|
||||
|
||||
// Returns the current name of the thread, if previously specified.
|
||||
std::string name() const { return name_; }
|
||||
|
||||
|
|
|
@ -358,6 +358,7 @@ class Win32Thread : public Win32Handle<Thread> {
|
|||
}
|
||||
|
||||
int32_t priority() override { return GetThreadPriority(handle_); }
|
||||
uint32_t id() const override { return GetThreadId(handle_); }
|
||||
|
||||
void set_priority(int32_t new_priority) override {
|
||||
SetThreadPriority(handle_, new_priority);
|
||||
|
|
Loading…
Reference in New Issue