mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-12-30 15:17:27 +00:00
40add8f9a2
make precompiled header slimmer under Linux to increase CI and dev-machine build-times make sure unused modules don't compile add unused modules to the VS project to easier keep track of them
41 lines
719 B
C++
41 lines
719 B
C++
#include <stdafx.h>
|
|
#include "Emu/ConLog.h"
|
|
#include "Emu/Memory/Memory.h"
|
|
#include "Emu/System.h"
|
|
#include "Emu/CPU/CPUThread.h"
|
|
|
|
#include "Utilities/SMutex.h"
|
|
|
|
__forceinline void SM_Sleep()
|
|
{
|
|
Sleep(1);
|
|
}
|
|
|
|
#ifdef _WIN32
|
|
__declspec(thread)
|
|
#elif __APPLE__
|
|
__thread
|
|
#else
|
|
thread_local
|
|
#endif
|
|
size_t g_this_thread_id = 0;
|
|
|
|
__forceinline 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());
|
|
}
|
|
|
|
__forceinline u32 SM_GetCurrentCPUThreadId()
|
|
{
|
|
if (CPUThread* t = GetCurrentCPUThread())
|
|
{
|
|
return t->GetId();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
__forceinline be_t<u32> SM_GetCurrentCPUThreadIdBE()
|
|
{
|
|
return SM_GetCurrentCPUThreadId();
|
|
}
|