summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-12-05 09:07:00 +0100
committerbunnei <bunneidev@gmail.com>2020-12-06 09:27:13 +0100
commitb1b4f2337e286e2c079634906224fc67ae3ff7c3 (patch)
treecbf6d4f17bc0d142391b04f68d58eecc443827de
parenthle: kernel: KAbstractSchedulerLock: Various style fixes based on code review feedback. (diff)
downloadyuzu-b1b4f2337e286e2c079634906224fc67ae3ff7c3.tar
yuzu-b1b4f2337e286e2c079634906224fc67ae3ff7c3.tar.gz
yuzu-b1b4f2337e286e2c079634906224fc67ae3ff7c3.tar.bz2
yuzu-b1b4f2337e286e2c079634906224fc67ae3ff7c3.tar.lz
yuzu-b1b4f2337e286e2c079634906224fc67ae3ff7c3.tar.xz
yuzu-b1b4f2337e286e2c079634906224fc67ae3ff7c3.tar.zst
yuzu-b1b4f2337e286e2c079634906224fc67ae3ff7c3.zip
-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 @@
namespace Kernel {
template <typename T>
-concept KLockable = !std::is_reference<T>::value && requires(T & t) {
+concept KLockable = !std::is_reference_v<T> && requires(T & t) {
{ t.Lock() }
->std::same_as<void>;
{ t.Unlock() }
@@ -20,11 +20,7 @@ concept KLockable = !std::is_reference<T>::value && requires(T & t) {
};
template <typename T>
-requires KLockable<T> class KScopedLock : NonCopyable {
-
-private:
- T* lock_ptr;
-
+requires KLockable<T> class KScopedLock {
public:
explicit KScopedLock(T* l) : lock_ptr(l) {
this->lock_ptr->Lock();
@@ -34,6 +30,12 @@ public:
~KScopedLock() {
this->lock_ptr->Unlock();
}
+
+ KScopedLock(const KScopedLock&) = delete;
+ KScopedLock(KScopedLock&&) = delete;
+
+private:
+ T* lock_ptr;
};
} // namespace Kernel