kernel: use z_swap_unlocked in k_thread_abort

z_swap_unlocked() does the same construction of using a
dummy spinlock; just use that and make the code simpler.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2020-02-14 12:15:14 -08:00 committed by Anas Nashif
commit 5a2619e17a

View file

@ -38,9 +38,7 @@ void z_impl_k_thread_abort(k_tid_t thread)
* for "is _current dead" and we don't want one for
* performance reasons.
*/
struct k_spinlock lock = {};
z_swap(&lock, k_spin_lock(&lock));
z_swap_unlocked();
} else {
z_reschedule_unlocked();
}