Scheduler: adjust SSE saving conditions
This commit is contained in:
parent
1ecd24f5d6
commit
38470724dc
@ -272,9 +272,12 @@ void Scheduler::task_yield(Context* context)
|
||||
sched_current_task = sched_current_task->next_task;
|
||||
if (sched_current_task->state == sched_current_task->Running)
|
||||
{
|
||||
if (sched_current_task->id != original_task->id)
|
||||
if (sched_current_task->id != original_task->id || was_idle)
|
||||
{
|
||||
if (!was_idle && original_task->is_user_task()) { task_save_floating(*original_task); }
|
||||
if (!was_idle && original_task->is_user_task() && original_task->state != original_task->Exited)
|
||||
{
|
||||
task_save_floating(*original_task);
|
||||
}
|
||||
if (sched_current_task->is_user_task()) { task_restore_floating(*sched_current_task); }
|
||||
}
|
||||
sched_current_task->task_time = 20;
|
||||
@ -282,7 +285,10 @@ void Scheduler::task_yield(Context* context)
|
||||
return;
|
||||
}
|
||||
} while (sched_current_task != original_task);
|
||||
if (!was_idle && original_task->is_user_task()) task_save_floating(*original_task);
|
||||
if (!was_idle && original_task->is_user_task() && original_task->state != original_task->Exited)
|
||||
{
|
||||
task_save_floating(*original_task);
|
||||
}
|
||||
sched_current_task = &idle_task;
|
||||
sched_current_task->task_time = frequency;
|
||||
if (!was_idle) { set_context_from_task(*sched_current_task, context); }
|
||||
|
Loading…
Reference in New Issue
Block a user