From 71792e4b3fafbf54b97d20b1be915043a79b2eb6 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 7 Mar 2022 20:25:43 +0100 Subject: Kernel: Make SpinlockProtected constructor forward all arguments This allows you to instantiate SpinlockProtected where T requires constructor arguments. --- Kernel/Locking/SpinlockProtected.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Kernel/Locking/SpinlockProtected.h b/Kernel/Locking/SpinlockProtected.h index 39a7b134b2..dd0344708c 100644 --- a/Kernel/Locking/SpinlockProtected.h +++ b/Kernel/Locking/SpinlockProtected.h @@ -46,7 +46,11 @@ private: auto lock_mutable() { return Locked(m_value, m_spinlock); } public: - SpinlockProtected() = default; + template + SpinlockProtected(Args&&... args) + : m_value(forward(args)...) + { + } template decltype(auto) with(Callback callback) const -- cgit v1.2.3