mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
add shutdown check in the scheduler => if true, switch to the idle task
This commit is contained in:
parent
695e4e9dc9
commit
5048c3d3eb
1 changed files with 8 additions and 0 deletions
|
@ -782,6 +782,14 @@ size_t** scheduler(void)
|
|||
readyqueues[core_id].old_task = curr_task;
|
||||
else readyqueues[core_id].old_task = NULL; // reset old task
|
||||
|
||||
// do we receive a shutdown IPI => only the idle task should get the core
|
||||
if (BUILTIN_EXPECT(go_down, 0)) {
|
||||
if (curr_task->status == TASK_IDLE)
|
||||
goto get_task_out;
|
||||
curr_task = readyqueues[core_id].idle;
|
||||
set_per_core(current_task, curr_task);
|
||||
}
|
||||
|
||||
prio = msb(readyqueues[core_id].prio_bitmap); // determines highest priority
|
||||
if (prio > MAX_PRIO) {
|
||||
if ((curr_task->status == TASK_RUNNING) || (curr_task->status == TASK_IDLE))
|
||||
|
|
Loading…
Add table
Reference in a new issue