mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
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:
@ -406,7 +406,7 @@ void ResetRumble()
|
|||||||
{
|
{
|
||||||
unsigned char rumble[5] = {0x11, 0, 0, 0, 0};
|
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);
|
memcpy(s_controller_write_payload, rumble, 5);
|
||||||
s_controller_write_payload_size.store(5);
|
s_controller_write_payload_size.store(5);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user