kernel: don't reschedule thread abort in ISR

Zephyr has a policy of invoking the scheduler on the way
out of IRQs anyway for all arches, this is unnecessary.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2020-08-14 10:45:39 -07:00 committed by Alberto Escolar
parent be0d69f1e6
commit 282cd932c8

View file

@ -33,14 +33,19 @@ void z_impl_k_thread_abort(k_tid_t thread)
z_thread_single_abort(thread);
z_thread_monitor_exit(thread);
if (thread == _current && !arch_is_in_isr()) {
/* Direct use of swap: reschedule doesn't have a test
* for "is _current dead" and we don't want one for
* performance reasons.
*/
z_swap_unlocked();
} else {
z_reschedule_unlocked();
/* If we're in an interrupt handler, we reschedule on the way out
* anyway, nothing needs to be done here.
*/
if (!arch_is_in_isr()) {
if (thread == _current) {
/* Direct use of swap: reschedule doesn't have a test
* for "is _current dead" and we don't want one for
* performance reasons.
*/
z_swap_unlocked();
} else {
z_reschedule_unlocked();
}
}
}
#endif