Skip to content
Snippets Groups Projects
Commit c0187690 authored by Lioncash's avatar Lioncash
Browse files

k_scoped_lock: delete copy and move assignment operators

If we delete the copy and move constructor, we should also be deleting
the copy and move assignment operators (and even if this were intended,
it would be pretty odd to not document why it's done this way).
parent bc30aa82
No related branches found
No related tags found
No related merge requests found
...@@ -25,14 +25,17 @@ public: ...@@ -25,14 +25,17 @@ public:
explicit KScopedLock(T* l) : lock_ptr(l) { explicit KScopedLock(T* l) : lock_ptr(l) {
this->lock_ptr->Lock(); this->lock_ptr->Lock();
} }
explicit KScopedLock(T& l) : KScopedLock(std::addressof(l)) { /* ... */ explicit KScopedLock(T& l) : KScopedLock(std::addressof(l)) {}
}
~KScopedLock() { ~KScopedLock() {
this->lock_ptr->Unlock(); this->lock_ptr->Unlock();
} }
KScopedLock(const KScopedLock&) = delete; KScopedLock(const KScopedLock&) = delete;
KScopedLock& operator=(const KScopedLock&) = delete;
KScopedLock(KScopedLock&&) = delete; KScopedLock(KScopedLock&&) = delete;
KScopedLock& operator=(KScopedLock&&) = delete;
private: private:
T* lock_ptr; T* lock_ptr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment