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.
This commit is contained in:
nyanpasu64 2022-03-27 22:37:43 -07:00
parent 7616027684
commit b5a7ae52b5
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}