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(); }