diff options
| author | nyanpasu64 <nyanpasu64@tuta.io> | 2022-03-27 22:37:43 -0700 |
|---|---|---|
| committer | nyanpasu64 <nyanpasu64@tuta.io> | 2022-03-27 22:39:26 -0700 |
| commit | b5a7ae52b56abd1b3aaa37786debcd95cc4e6057 (patch) | |
| tree | e91306ccd27bb11a54a15d61799cd5e1e29a7363 /Source/Core/InputCommon | |
| parent | 76160276848bd2bbfa6be5335c9cd374ead49a58 (diff) | |
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.
Diffstat (limited to 'Source/Core/InputCommon')
| -rw-r--r-- | Source/Core/InputCommon/GCAdapter_Android.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<std::mutex> lk(s_read_mutex); + std::lock_guard<std::mutex> lk(s_write_mutex); memcpy(s_controller_write_payload, rumble, 5); s_controller_write_payload_size.store(5); } |
