mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-03 21:41:19 +12:00
Input: Fix potential race condition
Operator = for ControllerButtonState wasn't properly synchronized
This commit is contained in:
parent
9d55f46eb1
commit
f2671f417f
1 changed files with 1 additions and 0 deletions
|
@ -102,6 +102,7 @@ struct ControllerButtonState
|
||||||
ControllerButtonState& operator=(ControllerButtonState&& other)
|
ControllerButtonState& operator=(ControllerButtonState&& other)
|
||||||
{
|
{
|
||||||
cemu_assert_debug(!other.m_spinlock.is_locked());
|
cemu_assert_debug(!other.m_spinlock.is_locked());
|
||||||
|
std::scoped_lock _l(this->m_spinlock, other.m_spinlock);
|
||||||
this->m_pressedButtons = std::move(other.m_pressedButtons);
|
this->m_pressedButtons = std::move(other.m_pressedButtons);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue