summaryrefslogtreecommitdiff
path: root/Kernel/Locking/Mutex.h
diff options
context:
space:
mode:
authorJean-Baptiste Boric <jblbeurope@gmail.com>2021-07-18 09:25:13 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-07 11:48:00 +0200
commitaea98a85d1904de4f2fec4a111f4729a4a492b3b (patch)
tree76268003f9e9710fe91cc2362cbc00b17c7a723e /Kernel/Locking/Mutex.h
parent2c3b0baf7652e6ba64ffd1414997270a3ab3eaea (diff)
downloadserenity-aea98a85d1904de4f2fec4a111f4729a4a492b3b.zip
Kernel: Move Lockable into its own header
Diffstat (limited to 'Kernel/Locking/Mutex.h')
-rw-r--r--Kernel/Locking/Mutex.h22
1 files changed, 0 insertions, 22 deletions
diff --git a/Kernel/Locking/Mutex.h b/Kernel/Locking/Mutex.h
index 28c826c1cd..a9277caddf 100644
--- a/Kernel/Locking/Mutex.h
+++ b/Kernel/Locking/Mutex.h
@@ -182,28 +182,6 @@ private:
bool m_locked { true };
};
-template<typename T>
-class Lockable {
-public:
- Lockable() = default;
- Lockable(T&& resource)
- : m_resource(move(resource))
- {
- }
- [[nodiscard]] Mutex& lock() { return m_lock; }
- [[nodiscard]] T& resource() { return m_resource; }
-
- [[nodiscard]] T lock_and_copy()
- {
- MutexLocker locker(m_lock);
- return m_resource;
- }
-
-private:
- T m_resource;
- Mutex m_lock;
-};
-
class ScopedLockRelease {
AK_MAKE_NONCOPYABLE(ScopedLockRelease);