diff options
author | Mai M <mathew1800@gmail.com> | 2021-06-22 22:19:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-22 22:19:34 -0400 |
commit | 95b4c78b07434f0b668b1168bf859434cae37a6c (patch) | |
tree | f2ab7bc1d40ae6c0d767506a1d147c3ef1a62744 /src/input_common/mouse/mouse_input.h | |
parent | 4ec7d79174e5383941767ace57888168c5f6b017 (diff) | |
parent | 0a39163a90de377843d4726154a0247caa928fa1 (diff) |
Merge pull request #6509 from ReinUsesLisp/mouse-datarace
input_common/mouse_input: Fix data race
Diffstat (limited to 'src/input_common/mouse/mouse_input.h')
-rw-r--r-- | src/input_common/mouse/mouse_input.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/input_common/mouse/mouse_input.h b/src/input_common/mouse/mouse_input.h index 5a971ad67..c8bae99c1 100644 --- a/src/input_common/mouse/mouse_input.h +++ b/src/input_common/mouse/mouse_input.h @@ -6,6 +6,7 @@ #include <array> #include <mutex> +#include <stop_token> #include <thread> #include "common/common_types.h" @@ -85,7 +86,7 @@ public: [[nodiscard]] const MouseData& GetMouseState(std::size_t button) const; private: - void UpdateThread(); + void UpdateThread(std::stop_token stop_token); void UpdateYuzuSettings(); void StopPanning(); @@ -105,12 +106,11 @@ private: u16 buttons{}; u16 toggle_buttons{}; u16 lock_buttons{}; - std::thread update_thread; + std::jthread update_thread; MouseButton last_button{MouseButton::Undefined}; std::array<MouseInfo, 7> mouse_info; Common::SPSCQueue<MouseStatus> mouse_queue; bool configuring{false}; - bool update_thread_running{true}; int mouse_panning_timout{}; }; } // namespace MouseInput |