Small refactoring

This commit is contained in:
Nekotekina 2014-09-15 02:17:24 +04:00
parent 8f1a8450be
commit 597d07bf24
46 changed files with 348 additions and 372 deletions

View file

@ -20,24 +20,3 @@ void SM_Sleep()
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
}
thread_local size_t g_this_thread_id = 0;
size_t SM_GetCurrentThreadId()
{
return g_this_thread_id ? g_this_thread_id : g_this_thread_id = std::hash<std::thread::id>()(std::this_thread::get_id());
}
u32 SM_GetCurrentCPUThreadId()
{
if (CPUThread* t = GetCurrentCPUThread())
{
return t->GetId();
}
return 0;
}
be_t<u32> SM_GetCurrentCPUThreadIdBE()
{
return be_t<u32>::MakeFromLE(SM_GetCurrentCPUThreadId());
}