1
Fork 0
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:
Andreas Kling 2022-03-07 20:25:43 +01:00
parent 7543c34d07
commit 71792e4b3f

View file

@ -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