mingw: fix thread affinity for ming

This commit is contained in:
Craig Carnell 2025-12-08 19:25:24 +00:00
parent 62a6a76bf4
commit ee680f0191

View File

@ -48,7 +48,8 @@ int CurrentThreadId()
void SetThreadAffinity(std::thread::native_handle_type thread, u32 mask)
{
SetThreadAffinityMask(thread, mask);
// Cast required for MINGW
SetThreadAffinityMask(reinterpret_cast<HANDLE>(thread), mask);
}
void SetCurrentThreadAffinity(u32 mask)
@ -89,6 +90,7 @@ static void SetCurrentThreadNameViaException(const char* name)
info.dwThreadID = static_cast<DWORD>(-1);
info.dwFlags = 0;
#if defined(_MSC_VER)
__try
{
RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info);
@ -96,6 +98,7 @@ static void SetCurrentThreadNameViaException(const char* name)
__except (EXCEPTION_CONTINUE_EXECUTION)
{
}
#endif
}
static void SetCurrentThreadNameViaApi(const char* name)