diff --git a/AK/Singleton.h b/AK/Singleton.h index 3e67dea1304..a0c6fa32902 100644 --- a/AK/Singleton.h +++ b/AK/Singleton.h @@ -12,6 +12,7 @@ #ifdef KERNEL # include # include +# include #else # include #endif @@ -30,6 +31,18 @@ struct SingletonInstanceCreator { } }; +#ifdef KERNEL + +// FIXME: Find a nice way of injecting the lock rank into the singleton. +template +struct SingletonInstanceCreator> { + static Kernel::SpinlockProtected* create() + { + return new Kernel::SpinlockProtected { Kernel::LockRank::None }; + } +}; +#endif + template::create> class Singleton { AK_MAKE_NONCOPYABLE(Singleton);