diff --git a/headers/private/kernel/util/AutoLock.h b/headers/private/kernel/util/AutoLock.h index b98cc57473..2f46733506 100644 --- a/headers/private/kernel/util/AutoLock.h +++ b/headers/private/kernel/util/AutoLock.h @@ -14,6 +14,7 @@ #include #include +#include namespace BPrivate { @@ -161,6 +162,24 @@ private: // InterruptsSpinLocker typedef AutoLocker InterruptsSpinLocker; +// ThreadCPUPinLocking +class ThreadCPUPinLocking { +public: + inline bool Lock(struct thread* thread) + { + thread_pin_to_current_cpu(thread); + return true; + } + + inline void Unlock(struct thread* thread) + { + thread_unpin_from_current_cpu(thread); + } +}; + +// MutexLocker +typedef AutoLocker ThreadCPUPinner; + } // namespace BPrivate using BPrivate::AutoLocker; @@ -171,5 +190,6 @@ using BPrivate::WriteLocker; using BPrivate::InterruptsLocker; using BPrivate::SpinLocker; using BPrivate::InterruptsSpinLocker; +using BPrivate::ThreadCPUPinner; #endif // KERNEL_UTIL_AUTO_LOCKER_H