1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

Implement thread_ctrl::get_tid()

This commit is contained in:
Nekotekina 2021-03-06 20:10:48 +03:00
parent ded828dfc9
commit 55c75d2c87
2 changed files with 12 additions and 0 deletions

View File

@ -2978,3 +2978,12 @@ std::pair<void*, usz> thread_ctrl::get_thread_stack()
#endif #endif
return {saddr, ssize}; return {saddr, ssize};
} }
u64 thread_ctrl::get_tid()
{
#ifdef _WIN32
return GetCurrentThreadId();
#else
return reinterpret_cast<u64>(pthread_self());
#endif
}

View File

@ -339,6 +339,9 @@ public:
} }
}; };
// Get thread ID (works for all threads)
static u64 get_tid();
private: private:
// Miscellaneous // Miscellaneous
static const u64 process_affinity_mask; static const u64 process_affinity_mask;