mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-04 15:19:09 +00: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:
parent
7616027684
commit
b5a7ae52b5
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue