InputCommon: Fix callback dispatch deadlock
Make sure m_is_populating_devices is true when a WM_INPUT_DEVICE_CHANGE event is received directly on the ciface thread, so that callbacks do not occur while removing devices. This breaks a hold-and-wait deadlock between the ciface thread and the CPU thread when using emulated Wiimotes. Co-authored-by: brainleq <[email protected]> Co-authored-by: oldmud0 <[email protected]>
This commit is contained in:
1 parent
d312495934
commit
00ec25d520
3 files changed
+18
-2
No files matched your search
@@ -28,8 +28,10 @@ static LRESULT CALLBACK WindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARA
|
||||
{
|
||||
if (message == WM_INPUT_DEVICE_CHANGE)
|
||||
{
|
||||
ciface::DInput::PopulateDevices(s_hwnd);
|
||||
ciface::XInput::PopulateDevices();
|
||||
g_controller_interface.PlatformPopulateDevices([] {
|
||||
ciface::DInput::PopulateDevices(s_hwnd);
|
||||
ciface::XInput::PopulateDevices();
|
||||
});
|
||||
s_done_populating.Set();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user