summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2020-12-05 00:07:00 -0800
committerGravatar bunnei2020-12-06 00:27:13 -0800
commitb1b4f2337e286e2c079634906224fc67ae3ff7c3 (patch)
treecbf6d4f17bc0d142391b04f68d58eecc443827de /src
parenthle: kernel: KAbstractSchedulerLock: Various style fixes based on code review... (diff)
downloadyuzu-b1b4f2337e286e2c079634906224fc67ae3ff7c3.tar.gz
yuzu-b1b4f2337e286e2c079634906224fc67ae3ff7c3.tar.xz
yuzu-b1b4f2337e286e2c079634906224fc67ae3ff7c3.zip
hle: kernel: KScopedLock: Various style fixes based on code review feedback.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/k_scoped_lock.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/hle/kernel/k_scoped_lock.h b/src/core/hle/kernel/k_scoped_lock.h
index 03320859f..d7cc557b2 100644
--- a/src/core/hle/kernel/k_scoped_lock.h
+++ b/src/core/hle/kernel/k_scoped_lock.h
@@ -12,7 +12,7 @@
12namespace Kernel { 12namespace Kernel {
13 13
14template <typename T> 14template <typename T>
15concept KLockable = !std::is_reference<T>::value && requires(T & t) { 15concept KLockable = !std::is_reference_v<T> && requires(T & t) {
16 { t.Lock() } 16 { t.Lock() }
17 ->std::same_as<void>; 17 ->std::same_as<void>;
18 { t.Unlock() } 18 { t.Unlock() }
@@ -20,11 +20,7 @@ concept KLockable = !std::is_reference<T>::value && requires(T & t) {
20}; 20};
21 21
22template <typename T> 22template <typename T>
23requires KLockable<T> class KScopedLock : NonCopyable { 23requires KLockable<T> class KScopedLock {
24
25private:
26 T* lock_ptr;
27
28public: 24public:
29 explicit KScopedLock(T* l) : lock_ptr(l) { 25 explicit KScopedLock(T* l) : lock_ptr(l) {
30 this->lock_ptr->Lock(); 26 this->lock_ptr->Lock();
@@ -34,6 +30,12 @@ public:
34 ~KScopedLock() { 30 ~KScopedLock() {
35 this->lock_ptr->Unlock(); 31 this->lock_ptr->Unlock();
36 } 32 }
33
34 KScopedLock(const KScopedLock&) = delete;
35 KScopedLock(KScopedLock&&) = delete;
36
37private:
38 T* lock_ptr;
37}; 39};
38 40
39} // namespace Kernel 41} // namespace Kernel