kernel/sched: Add missing SMP thread abort case
The loop in thread abort on SMP where we wait for the results on an IPI correctly handled the case where a thread running on another CPU gets its interrupt and self-aborts, but it missed the case where the other thread pends before receiving the interrupt. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
b0158cc81f
commit
d442927667
1 changed files with 6 additions and 1 deletions
|
@ -1073,10 +1073,15 @@ void z_sched_abort(struct k_thread *thread)
|
|||
*/
|
||||
while ((thread->base.thread_state & _THREAD_DEAD) == 0U) {
|
||||
LOCKED(&sched_spinlock) {
|
||||
if (z_is_thread_queued(thread)) {
|
||||
if (z_is_thread_prevented_from_running(thread)) {
|
||||
__ASSERT(!z_is_thread_queued(thread), "");
|
||||
thread->base.thread_state |= _THREAD_DEAD;
|
||||
} else if (z_is_thread_queued(thread)) {
|
||||
_priq_run_remove(&_kernel.ready_q.runq, thread);
|
||||
z_mark_thread_as_not_queued(thread);
|
||||
thread->base.thread_state |= _THREAD_DEAD;
|
||||
} else {
|
||||
k_busy_wait(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue