Merge pull request #2015 from CookiePLMonster/affinity-fix

Fix affinity for EmuCreateDeviceProxy thread
This commit is contained in:
Luke Usher 2020-10-28 16:59:52 +00:00 committed by GitHub
commit 38242d48f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -1605,12 +1605,11 @@ void EmuD3DInit()
{ {
// create the create device proxy thread // create the create device proxy thread
{ {
DWORD dwThreadId; HANDLE thread = CreateThread(nullptr, 0, EmuCreateDeviceProxy, nullptr, 0, nullptr);
CreateThread(nullptr, 0, EmuCreateDeviceProxy, nullptr, 0, &dwThreadId);
// Ported from Dxbx : // Ported from Dxbx :
// If possible, assign this thread to another core than the one that runs Xbox1 code : // If possible, assign this thread to another core than the one that runs Xbox1 code :
SetThreadAffinityMask(&dwThreadId, g_CPUOthers); SetThreadAffinityMask(thread, g_CPUOthers);
CloseHandle(thread);
} }
// Initialise CreateDevice Proxy Data struct // Initialise CreateDevice Proxy Data struct