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
commit 71792e4b3f
Notes: sideshowbarker 2024-07-17 17:49:28 +09:00

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