rpcs3/Utilities/SMutex.cpp

28 lines
438 B
C++
Raw Normal View History

2014-02-05 15:55:32 +04:00
#include <stdafx.h>
#include <Utilities/SMutex.h>
2014-03-03 12:05:15 +01:00
2014-02-05 15:55:32 +04:00
__forceinline void SM_Sleep()
{
Sleep(1);
}
2014-02-26 15:27:06 +04:00
__forceinline size_t SM_GetCurrentThreadId()
2014-02-05 15:55:32 +04:00
{
2014-03-03 12:05:15 +01:00
return std::hash<std::thread::id>()(std::this_thread::get_id());
2014-02-05 15:55:32 +04:00
}
__forceinline u32 SM_GetCurrentCPUThreadId()
{
if (CPUThread* t = GetCurrentCPUThread())
{
return t->GetId();
}
return 0;
}
__forceinline be_t<u32> SM_GetCurrentCPUThreadIdBE()
{
return SM_GetCurrentCPUThreadId();
}