mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:17:35 +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
1 changed files with 1 additions and 1 deletions
|
@ -164,6 +164,7 @@ bool Scheduler::pick_next()
|
||||||
|
|
||||||
bool Scheduler::yield()
|
bool Scheduler::yield()
|
||||||
{
|
{
|
||||||
|
InterruptDisabler disabler;
|
||||||
ASSERT(!s_in_yield);
|
ASSERT(!s_in_yield);
|
||||||
s_in_yield = true;
|
s_in_yield = true;
|
||||||
|
|
||||||
|
@ -174,7 +175,6 @@ bool Scheduler::yield()
|
||||||
|
|
||||||
//dbgprintf("%s<%u> yield()\n", current->name().characters(), current->pid());
|
//dbgprintf("%s<%u> yield()\n", current->name().characters(), current->pid());
|
||||||
|
|
||||||
InterruptDisabler disabler;
|
|
||||||
if (!pick_next()) {
|
if (!pick_next()) {
|
||||||
s_in_yield = false;
|
s_in_yield = false;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue