diff options
| author | Léo Lam <leo@leolam.fr> | 2021-11-23 16:27:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-23 16:27:03 +0100 |
| commit | e1e3db13baabefa89991388d37db0bb260c4f535 (patch) | |
| tree | 49e2d9520c09b08e9cc5b0013c9f991687554900 /Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp | |
| parent | ba62019eb5fa2f207821a8cfd9610533d12313e6 (diff) | |
| parent | 1badceb455dae28a93a51da6c5cda0b510f93701 (diff) | |
Merge pull request #10228 from Filoppi/fix_android_input_deadlock
ControllerInterface: fix UpdateReferences() deadlock
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp b/Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp index c804e303f2..9cd7ced6f9 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControllerEmu.cpp @@ -18,6 +18,8 @@ namespace ControllerEmu { +// This should theoretically be per EmulatedController instance, +// though no EmulatedController usually run in parallel, so it makes little difference static std::recursive_mutex s_get_state_mutex; std::string EmulatedController::GetDisplayName() const @@ -77,6 +79,7 @@ void EmulatedController::UpdateSingleControlReference(const ControllerInterface& { ciface::ExpressionParser::ControlEnvironment env(devi, GetDefaultDevice(), m_expression_vars); + const auto lock = GetStateLock(); ref->UpdateReference(env); env.CleanUnusedVariables(); |
