1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:47:34 +00:00

LibThreading: Remove unused "Lockable" class

This commit is contained in:
Andreas Kling 2021-07-09 11:07:53 +02:00
parent 1da06f9dfd
commit ce5d2b4f16

View file

@ -61,33 +61,4 @@ inline void Lock::unlock()
pthread_mutex_unlock(&m_mutex);
}
template<typename T>
class Lockable {
public:
Lockable() { }
template<typename... Args>
Lockable(Args&&... args)
: m_resource(forward(args)...)
{
}
Lockable(T&& resource)
: m_resource(move(resource))
{
}
Lock& lock() { return m_lock; }
T& resource() { return m_resource; }
T lock_and_copy()
{
Locker locker(m_lock);
return m_resource;
}
private:
T m_resource;
Lock m_lock;
};
}