sysinfo.cpp: Implement utils::main_tid (main thread id)
Careful.
This commit is contained in:
@@ -476,3 +476,15 @@ u32 utils::get_cpu_model()
|
|||||||
|
|
||||||
return g_value;
|
return g_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace utils
|
||||||
|
{
|
||||||
|
extern const u64 main_tid = []() -> u64
|
||||||
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
return GetCurrentThreadId();
|
||||||
|
#else
|
||||||
|
return reinterpret_cast<u64>(pthread_self());
|
||||||
|
#endif
|
||||||
|
}();
|
||||||
|
}
|
||||||
|
|||||||
@@ -54,4 +54,6 @@ namespace utils
|
|||||||
u32 get_cpu_family();
|
u32 get_cpu_family();
|
||||||
|
|
||||||
u32 get_cpu_model();
|
u32 get_cpu_model();
|
||||||
|
|
||||||
|
extern const u64 main_tid;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user