mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:07:35 +00:00
Kernel: Make SpinlockProtected constructor forward all arguments
This allows you to instantiate SpinlockProtected<T> where T requires constructor arguments.
This commit is contained in:
parent
7543c34d07
commit
71792e4b3f
1 changed files with 5 additions and 1 deletions
|
@ -46,7 +46,11 @@ private:
|
|||
auto lock_mutable() { return Locked<T>(m_value, m_spinlock); }
|
||||
|
||||
public:
|
||||
SpinlockProtected() = default;
|
||||
template<typename... Args>
|
||||
SpinlockProtected(Args&&... args)
|
||||
: m_value(forward<Args>(args)...)
|
||||
{
|
||||
}
|
||||
|
||||
template<typename Callback>
|
||||
decltype(auto) with(Callback callback) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue