input: fix minor data race

While usually not exposed to the user, there was a slight chance that user input was read in a dirty state.
This became apparent during usage of the new pressure sensitivity button
This commit is contained in:
Megamouse 2021-08-08 18:50:37 +02:00
parent 3fa9d23627
commit f0d51899c1
7 changed files with 69 additions and 52 deletions

View file

@ -23,7 +23,7 @@ public:
~pad_thread();
PadInfo& GetInfo() { return m_info; }
auto& GetPads() { return m_pads; }
auto& GetPads() { return m_pads_interface; }
void SetRumble(const u32 pad, u8 largeMotor, bool smallMotor);
void Init();
void SetIntercepted(bool intercepted);
@ -44,6 +44,7 @@ protected:
PadInfo m_info{ 0, 0, false };
std::array<std::shared_ptr<Pad>, CELL_PAD_MAX_PORT_NUM> m_pads;
std::array<std::shared_ptr<Pad>, CELL_PAD_MAX_PORT_NUM> m_pads_interface;
std::shared_ptr<std::thread> thread;