[hid_core/frontend] use shared lock for accesses on emulated controller (reduces contention in FBSD)
Some checks failed
eden-license / license-header (pull_request) Failing after 18s

Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
lizzie 2025-09-22 20:52:50 +00:00
parent 7050b92d61
commit 3bdec989b7
Signed by: Lizzie
GPG key ID: 00287378CADCAB13
2 changed files with 47 additions and 48 deletions

View file

@ -7,6 +7,7 @@
#include <functional>
#include <memory>
#include <mutex>
#include <shared_mutex>
#include <unordered_map>
#include <vector>
@ -626,10 +627,10 @@ private:
StickDevices virtual_stick_devices;
ControllerMotionDevices virtual_motion_devices;
mutable std::mutex mutex;
mutable std::mutex callback_mutex;
mutable std::mutex npad_mutex;
mutable std::mutex connect_mutex;
mutable std::shared_mutex mutex;
mutable std::shared_mutex callback_mutex;
mutable std::shared_mutex npad_mutex;
mutable std::shared_mutex connect_mutex;
std::unordered_map<int, ControllerUpdateCallback> callback_list;
int last_callback_key = 0;