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:
parent
1da06f9dfd
commit
ce5d2b4f16
1 changed files with 0 additions and 29 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue