summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-11-25 13:48:00 +0100
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-12-18 16:33:28 +0100
commit54ea3c47c8ec50c62126ef7e01c21efc0c19799b (patch)
tree27350195e7de626bf35ab31c735c931f7b01d231 /src/core
parentutil: Add URL Request Interceptor for QWebEngine (diff)
downloadyuzu-54ea3c47c8ec50c62126ef7e01c21efc0c19799b.tar
yuzu-54ea3c47c8ec50c62126ef7e01c21efc0c19799b.tar.gz
yuzu-54ea3c47c8ec50c62126ef7e01c21efc0c19799b.tar.bz2
yuzu-54ea3c47c8ec50c62126ef7e01c21efc0c19799b.tar.lz
yuzu-54ea3c47c8ec50c62126ef7e01c21efc0c19799b.tar.xz
yuzu-54ea3c47c8ec50c62126ef7e01c21efc0c19799b.tar.zst
yuzu-54ea3c47c8ec50c62126ef7e01c21efc0c19799b.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp2
-rw-r--r--src/core/hle/service/hid/controllers/npad.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index f6a0770bf..d280e7caf 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -1058,7 +1058,7 @@ void Controller_NPad::ClearAllControllers() {
}
u32 Controller_NPad::GetAndResetPressState() {
- return std::exchange(press_state, 0);
+ return press_state.exchange(0);
}
bool Controller_NPad::IsControllerSupported(NPadControllerType controller) const {
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h
index 9fac00231..e2e826623 100644
--- a/src/core/hle/service/hid/controllers/npad.h
+++ b/src/core/hle/service/hid/controllers/npad.h
@@ -5,6 +5,7 @@
#pragma once
#include <array>
+#include <atomic>
#include "common/bit_field.h"
#include "common/common_types.h"
#include "core/frontend/input.h"
@@ -415,7 +416,7 @@ private:
bool IsControllerSupported(NPadControllerType controller) const;
void RequestPadStateUpdate(u32 npad_id);
- u32 press_state{};
+ std::atomic<u32> press_state{};
NpadStyleSet style{};
std::array<NPadEntry, 10> shared_memory_entries{};