[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
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:
parent
7050b92d61
commit
3bdec989b7
2 changed files with 47 additions and 48 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue