dolphin/Source/Core
Filoppi 1badceb455 ControllerInterface: fix UpdateReferences() deadlock
Removed useless locks to DeviceContainer::m_devices_mutex, as they were all already protected by m_devices_population_mutex.
We have no interest in blocking other threads that were potentially reading devices at the same time so this seems fine.
This simplifies the code, and I've adjusted a few comments which mentioned possible deadlock that should now be totally gone.

The deadlock could have happen if a thread directly called EmulatedController::UpdateReferences(), while another another thread also reached EmulatedController::UpdateReferences() within a call to ControllerInterface::UpdateDevices(), as the mentioned function locked both the DeviceContainer::m_devices_mutex and s_get_state_mutex at the same time.

The deadlock was frequent on game emulation startup on Android, due to the UpdateReferences() call in InputConfig::LoadConfig() and the UI thread triggering calls to ControllerInterface::UpdateDevices().
It could also have happened on Desktop if a user pressed "Refresh Devices" manually in the UI while the input config was loading.

Also brought some UpdateReferences() comments and thread safety fixes from https://github.com/dolphin-emu/dolphin/pull/9489
2021-11-20 16:54:36 +02:00
..
AudioCommon Merge pull request #10169 from leoetlino/fmt-localtime 2021-11-07 00:08:14 -04:00
Common Merge pull request #10208 from thatSteveFan/patch-1 2021-11-13 15:09:28 +01:00
Core DSP: Reword inappropriate references to Global User Directory 2021-11-14 22:55:50 +01:00
DiscIO Merge pull request #10184 from JosJuice/android-riivolution 2021-10-31 23:44:54 +01:00
DolphinNoGUI Add option for Never Hide Mouse Cursor 2021-10-12 21:04:27 -04:00
DolphinQt ControllerInterface: fix UpdateReferences() deadlock 2021-11-20 16:54:36 +02:00
InputCommon ControllerInterface: fix UpdateReferences() deadlock 2021-11-20 16:54:36 +02:00
MacUpdater treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
UICommon Core, DolphinQt, UICommon: Fix all cases of -Wrange-loop-construct in gcc 11 2021-11-02 13:50:21 +01:00
UpdaterCommon Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
VideoBackends MoltenVK: Use an external project instead of a pre-compiled dylib 2021-11-13 11:43:23 -08:00
VideoCommon VideoCommon: Use the copy filter for EFB copies as well as XFB copies 2021-11-11 17:22:50 -08:00
WinUpdater treewide: convert GPLv2+ license info to SPDX tags 2021-07-05 04:35:56 +02:00
CMakeLists.txt WinUpdater: Add CMakeLists.txt 2019-05-08 23:59:04 +02:00
DolphinLib.ARM64.props Implement ArmFPURoundMode.cpp 2021-04-25 15:56:19 +02:00
DolphinLib.props Core: Fix a -Wshadow warning in gcc 11 2021-11-02 13:50:21 +01:00
DolphinLib.vcxproj msbuild: Move DivUtils to DolphinLib.props 2021-08-31 22:48:07 -07:00
DolphinLib.vcxproj.user msbuild: bundle all dolphin "core" code into single library 2021-01-27 14:29:49 -08:00
DolphinLib.x64.props msbuild: bundle all dolphin "core" code into single library 2021-01-27 14:29:49 -08:00