mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
Kernel: Fix dumb race in Scheduler::yield() debug code.
It was perfectly possible for Scheduler::yield() to get interrupted after setting s_in_yield but before disabling interrupts.
This commit is contained in:
parent
07f4c8b01b
commit
e911caeb10
Notes:
sideshowbarker
2024-07-19 15:58:44 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e911caeb102
1 changed files with 1 additions and 1 deletions
|
@ -164,6 +164,7 @@ bool Scheduler::pick_next()
|
|||
|
||||
bool Scheduler::yield()
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
ASSERT(!s_in_yield);
|
||||
s_in_yield = true;
|
||||
|
||||
|
@ -174,7 +175,6 @@ bool Scheduler::yield()
|
|||
|
||||
//dbgprintf("%s<%u> yield()\n", current->name().characters(), current->pid());
|
||||
|
||||
InterruptDisabler disabler;
|
||||
if (!pick_next()) {
|
||||
s_in_yield = false;
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue