From b5a7ae52b56abd1b3aaa37786debcd95cc4e6057 Mon Sep 17 00:00:00 2001 From: nyanpasu64 Date: Sun, 27 Mar 2022 22:37:43 -0700 Subject: [PATCH] Fix locking the wrong mutex in GCAdapter_Android.cpp ResetRumble() I am not confident there are no race conditions between s_write_mutex, s_controller_write_payload_size, and s_controller_write_payload. But this code should be safer than before. --- Source/Core/InputCommon/GCAdapter_Android.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/InputCommon/GCAdapter_Android.cpp b/Source/Core/InputCommon/GCAdapter_Android.cpp index b129eaaf0f..499a9ece30 100644 --- a/Source/Core/InputCommon/GCAdapter_Android.cpp +++ b/Source/Core/InputCommon/GCAdapter_Android.cpp @@ -406,7 +406,7 @@ void ResetRumble() { unsigned char rumble[5] = {0x11, 0, 0, 0, 0}; { - std::lock_guard lk(s_read_mutex); + std::lock_guard lk(s_write_mutex); memcpy(s_controller_write_payload, rumble, 5); s_controller_write_payload_size.store(5); }