kernel/sched: Handle aboring _current correctly in SMP
In SMP, _current is not "queued". (The run queue only stores unscheduled threads because we can't rely on the head of the list being _current). We weren't updating the cache choice, which would flag swap_ok, so calling k_thread_abort(_current) (for example, when a thread exits from its entry function) would try to switch back into the thread and then run off the end of the function. Amusingly this was more benign than you'd think. Stumbled on it by accident. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
0f8bee9c07
commit
aed8288196
1 changed files with 1 additions and 1 deletions
|
@ -353,8 +353,8 @@ void z_remove_thread_from_ready_q(struct k_thread *thread)
|
|||
if (z_is_thread_queued(thread)) {
|
||||
_priq_run_remove(&_kernel.ready_q.runq, thread);
|
||||
z_mark_thread_as_not_queued(thread);
|
||||
update_cache(thread == _current);
|
||||
}
|
||||
update_cache(thread == _current);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue