From 5a2619e17af80c87038a5585049b23fc365ef667 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Fri, 14 Feb 2020 12:15:14 -0800 Subject: [PATCH] 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 --- kernel/thread_abort.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/thread_abort.c b/kernel/thread_abort.c index 6500827a158..0629b64322d 100644 --- a/kernel/thread_abort.c +++ b/kernel/thread_abort.c @@ -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(); }