diff options
| author | 2021-04-07 01:23:06 -0400 | |
|---|---|---|
| committer | 2021-04-07 01:23:08 -0400 | |
| commit | bc30aa82499baea00a4d985f922e489041660ee7 (patch) | |
| tree | 46d123dea11c83cb88f30a4cfbf472d1489cf0aa | |
| parent | k_scheduler: Mark KScopedSchedulerLock as [[nodiscard]] (diff) | |
| download | yuzu-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.h | 2 |
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 | ||
| 22 | template <typename T> | 22 | template <typename T> |
| 23 | requires KLockable<T> class KScopedLock { | 23 | requires KLockable<T> class [[nodiscard]] KScopedLock { |
| 24 | public: | 24 | public: |
| 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(); |