summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2021-04-07 01:23:06 -0400
committerGravatar Lioncash2021-04-07 01:23:08 -0400
commitbc30aa82499baea00a4d985f922e489041660ee7 (patch)
tree46d123dea11c83cb88f30a4cfbf472d1489cf0aa
parentk_scheduler: Mark KScopedSchedulerLock as [[nodiscard]] (diff)
downloadyuzu-bc30aa82499baea00a4d985f922e489041660ee7.tar.gz
yuzu-bc30aa82499baea00a4d985f922e489041660ee7.tar.xz
yuzu-bc30aa82499baea00a4d985f922e489041660ee7.zip
k_scoped_lock: Mark class as [[nodiscard]]
Prevents logic bugs of the kind described in the previous commit from slipping through.
-rw-r--r--src/core/hle/kernel/k_scoped_lock.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/hle/kernel/k_scoped_lock.h b/src/core/hle/kernel/k_scoped_lock.h
index d7cc557b2..543555680 100644
--- a/src/core/hle/kernel/k_scoped_lock.h
+++ b/src/core/hle/kernel/k_scoped_lock.h
@@ -20,7 +20,7 @@ concept KLockable = !std::is_reference_v<T> && requires(T & t) {
20}; 20};
21 21
22template <typename T> 22template <typename T>
23requires KLockable<T> class KScopedLock { 23requires KLockable<T> class [[nodiscard]] KScopedLock {
24public: 24public:
25 explicit KScopedLock(T* l) : lock_ptr(l) { 25 explicit KScopedLock(T* l) : lock_ptr(l) {
26 this->lock_ptr->Lock(); 26 this->lock_ptr->Lock();