sysinfo.cpp: Implement utils::main_tid (main thread id)

Careful.
This commit is contained in:
Nekotekina 2021-03-06 20:02:16 +03:00
parent c69c70cf5f
commit ded828dfc9
2 changed files with 14 additions and 0 deletions

View file

@ -476,3 +476,15 @@ u32 utils::get_cpu_model()
return g_value;
}
namespace utils
{
extern const u64 main_tid = []() -> u64
{
#ifdef _WIN32
return GetCurrentThreadId();
#else
return reinterpret_cast<u64>(pthread_self());
#endif
}();
}

View file

@ -54,4 +54,6 @@ namespace utils
u32 get_cpu_family();
u32 get_cpu_model();
extern const u64 main_tid;
}