Kernel: Make spinlocks more safe

Kernel now makes sure thread is not holding any spinlocks when it tries
to lock a mutex or yield. Spinlocks are supposed to be only used for
short times without the possibility of yielding
This commit is contained in:
2025-05-30 21:59:07 +03:00
parent 9f4b451501
commit 6542a037df
7 changed files with 72 additions and 34 deletions

View File

@@ -337,6 +337,8 @@ namespace Kernel
auto state = get_interrupt_state();
set_interrupt_state(InterruptState::Disabled);
ASSERT(!Thread::current().has_spinlock());
auto& processor_info = s_processors[current_id().as_u32()];
{