From e7def962f39395c2becd4123dfff391d2b8c4e95 Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Fri, 24 Jul 2015 18:41:53 -0500 Subject: [PATCH] Expose native thread id --- src/xenia/base/threading.h | 3 +++ src/xenia/base/threading_win.cc | 1 + 2 files changed, 4 insertions(+) diff --git a/src/xenia/base/threading.h b/src/xenia/base/threading.h index bdf70b9c4..3903d1099 100644 --- a/src/xenia/base/threading.h +++ b/src/xenia/base/threading.h @@ -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_; } diff --git a/src/xenia/base/threading_win.cc b/src/xenia/base/threading_win.cc index a78454c69..64da0111a 100644 --- a/src/xenia/base/threading_win.cc +++ b/src/xenia/base/threading_win.cc @@ -358,6 +358,7 @@ class Win32Thread : public Win32Handle { } 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);