From 16efb84eb98b6695dafa93b7f47ec4c4dbe4bcf6 Mon Sep 17 00:00:00 2001 From: Silent Date: Wed, 28 Oct 2020 17:47:34 +0100 Subject: [PATCH] Fix affinity for EmuCreateDeviceProxy thread --- src/core/hle/D3D8/Direct3D9/Direct3D9.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp index 2b39e843c..35754bde2 100644 --- a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp +++ b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp @@ -1605,12 +1605,11 @@ void EmuD3DInit() { // create the create device proxy thread { - DWORD dwThreadId; - - CreateThread(nullptr, 0, EmuCreateDeviceProxy, nullptr, 0, &dwThreadId); + HANDLE thread = CreateThread(nullptr, 0, EmuCreateDeviceProxy, nullptr, 0, nullptr); // Ported from Dxbx : // 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