diff options
author | Jean-Baptiste Boric <jblbeurope@gmail.com> | 2021-07-18 09:25:13 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-07 11:48:00 +0200 |
commit | aea98a85d1904de4f2fec4a111f4729a4a492b3b (patch) | |
tree | 76268003f9e9710fe91cc2362cbc00b17c7a723e /Kernel/Locking/Mutex.h | |
parent | 2c3b0baf7652e6ba64ffd1414997270a3ab3eaea (diff) | |
download | serenity-aea98a85d1904de4f2fec4a111f4729a4a492b3b.zip |
Kernel: Move Lockable into its own header
Diffstat (limited to 'Kernel/Locking/Mutex.h')
-rw-r--r-- | Kernel/Locking/Mutex.h | 22 |
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); |