mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-10 21:22:40 +00:00
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 <brainleq@users.noreply.github.com> Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
This commit is contained in:
parent
d312495934
commit
00ec25d520
3 changed files with 18 additions and 2 deletions
Source/Core/InputCommon/ControllerInterface
|
@ -140,6 +140,19 @@ void ControllerInterface::RefreshDevices()
|
|||
InvokeDevicesChangedCallbacks();
|
||||
}
|
||||
|
||||
void ControllerInterface::PlatformPopulateDevices(std::function<void()> callback)
|
||||
{
|
||||
if (!m_is_init)
|
||||
return;
|
||||
|
||||
m_is_populating_devices = true;
|
||||
|
||||
callback();
|
||||
|
||||
m_is_populating_devices = false;
|
||||
InvokeDevicesChangedCallbacks();
|
||||
}
|
||||
|
||||
// Remove all devices and call library cleanup functions
|
||||
void ControllerInterface::Shutdown()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue