Kernel: Move Scheduler::yield() lock check after interrupts disabled

I have no idea why this solves a bug where current processor has
scheduler lock at the beginning of yield.
This commit is contained in:
Bananymous 2024-05-31 02:56:39 +03:00
parent b760892de2
commit 84b3289a2a
1 changed files with 2 additions and 2 deletions

View File

@ -133,11 +133,11 @@ namespace Kernel
void Scheduler::yield() void Scheduler::yield()
{ {
ASSERT(!m_lock.current_processor_has_lock());
auto state = Processor::get_interrupt_state(); auto state = Processor::get_interrupt_state();
Processor::set_interrupt_state(InterruptState::Disabled); Processor::set_interrupt_state(InterruptState::Disabled);
ASSERT(!m_lock.current_processor_has_lock());
#if ARCH(x86_64) #if ARCH(x86_64)
asm volatile( asm volatile(
"movq %%rsp, %%rcx;" "movq %%rsp, %%rcx;"