Kernel: d{print,warn,error}ln(...) now has a spinlock
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include <kernel/Debug.h>
|
||||
#include <kernel/InterruptController.h>
|
||||
#include <kernel/Serial.h>
|
||||
#include <kernel/SpinLock.h>
|
||||
#include <kernel/Terminal/TTY.h>
|
||||
|
||||
namespace Debug
|
||||
@@ -53,4 +55,19 @@ namespace Debug
|
||||
return Kernel::TTY::putchar_current(ch);
|
||||
}
|
||||
|
||||
|
||||
static Kernel::RecursiveSpinLock s_debug_lock;
|
||||
|
||||
void DebugLock::lock()
|
||||
{
|
||||
if (interrupts_enabled())
|
||||
s_debug_lock.lock();
|
||||
}
|
||||
|
||||
void DebugLock::unlock()
|
||||
{
|
||||
if (interrupts_enabled())
|
||||
s_debug_lock.unlock();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user