aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/hid/controllers/keyboard.cpp
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2024-01-01 21:33:07 -0600
committerNarr the Reg <juangerman-13@hotmail.com>2024-01-03 20:21:16 -0600
commit55623222908d2fd979de9ab101b1deff33a622f8 (patch)
treeaba09a6d8801b28dbfb6c7f5f35b4a666db6d931 /src/core/hle/service/hid/controllers/keyboard.cpp
parent6a244465cef86d7329f12dd1dfd5d6fdd415a0ed (diff)
service: hid: Remove data races when handling shared memory
Diffstat (limited to 'src/core/hle/service/hid/controllers/keyboard.cpp')
-rw-r--r--src/core/hle/service/hid/controllers/keyboard.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/hle/service/hid/controllers/keyboard.cpp b/src/core/hle/service/hid/controllers/keyboard.cpp
index c72b3e5ce..c069bcbb2 100644
--- a/src/core/hle/service/hid/controllers/keyboard.cpp
+++ b/src/core/hle/service/hid/controllers/keyboard.cpp
@@ -22,10 +22,11 @@ void Keyboard::OnInit() {}
void Keyboard::OnRelease() {}
void Keyboard::OnUpdate(const Core::Timing::CoreTiming& core_timing) {
+ std::scoped_lock shared_lock{*shared_mutex};
const u64 aruid = applet_resource->GetActiveAruid();
auto* data = applet_resource->GetAruidData(aruid);
- if (data == nullptr) {
+ if (data == nullptr || !data->flag.is_assigned) {
return;
}