Implement thread_ctrl::get_tid()

This commit is contained in:
Nekotekina
2021-03-06 23:10:31 +03:00
parent ded828dfc9
commit 55c75d2c87
2 changed files with 12 additions and 0 deletions
+9
View File
@@ -2978,3 +2978,12 @@ std::pair<void*, usz> thread_ctrl::get_thread_stack()
#endif
return {saddr, ssize};
}
u64 thread_ctrl::get_tid()
{
#ifdef _WIN32
return GetCurrentThreadId();
#else
return reinterpret_cast<u64>(pthread_self());
#endif
}
+3
View File
@@ -339,6 +339,9 @@ public:
}
};
// Get thread ID (works for all threads)
static u64 get_tid();
private:
// Miscellaneous
static const u64 process_affinity_mask;