diff options
author | Andreas Kling <kling@serenityos.org> | 2021-08-10 01:16:08 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-10 02:49:37 +0200 |
commit | 9babb92a4b6682f13fef661fc80502611d54c265 (patch) | |
tree | 59edde0e3a28b10782d3d5e7fdc0881be322984a /Kernel/Thread.h | |
parent | 369e3da6a2ed81c217cc579ccc13a7952afcf87f (diff) | |
download | serenity-9babb92a4b6682f13fef661fc80502611d54c265.zip |
Kernel/SMP: Make entering/leaving critical sections multi-processor safe
By making these functions static we close a window where we could get
preempted after calling Processor::current() and move to another
processor.
Co-authored-by: Tom <tomut@yahoo.com>
Diffstat (limited to 'Kernel/Thread.h')
-rw-r--r-- | Kernel/Thread.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Thread.h b/Kernel/Thread.h index 172e580fb7..18516fba3a 100644 --- a/Kernel/Thread.h +++ b/Kernel/Thread.h @@ -921,9 +921,9 @@ public: for (;;) { // Yield to the scheduler, and wait for us to resume unblocked. VERIFY(!g_scheduler_lock.own_lock()); - VERIFY(Processor::current().in_critical()); + VERIFY(Processor::in_critical()); yield_assuming_not_holding_big_lock(); - VERIFY(Processor::current().in_critical()); + VERIFY(Processor::in_critical()); ScopedSpinLock block_lock2(m_block_lock); if (should_be_stopped() || state() == Stopped) { |