controllers/npad: Make press_state atomic
This commit is contained in:
parent
5836786246
commit
54ea3c47c8
|
@ -1058,7 +1058,7 @@ void Controller_NPad::ClearAllControllers() {
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 Controller_NPad::GetAndResetPressState() {
|
u32 Controller_NPad::GetAndResetPressState() {
|
||||||
return std::exchange(press_state, 0);
|
return press_state.exchange(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Controller_NPad::IsControllerSupported(NPadControllerType controller) const {
|
bool Controller_NPad::IsControllerSupported(NPadControllerType controller) const {
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <atomic>
|
||||||
#include "common/bit_field.h"
|
#include "common/bit_field.h"
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "core/frontend/input.h"
|
#include "core/frontend/input.h"
|
||||||
|
@ -415,7 +416,7 @@ private:
|
||||||
bool IsControllerSupported(NPadControllerType controller) const;
|
bool IsControllerSupported(NPadControllerType controller) const;
|
||||||
void RequestPadStateUpdate(u32 npad_id);
|
void RequestPadStateUpdate(u32 npad_id);
|
||||||
|
|
||||||
u32 press_state{};
|
std::atomic<u32> press_state{};
|
||||||
|
|
||||||
NpadStyleSet style{};
|
NpadStyleSet style{};
|
||||||
std::array<NPadEntry, 10> shared_memory_entries{};
|
std::array<NPadEntry, 10> shared_memory_entries{};
|
||||||
|
|
Reference in New Issue