From d082cd29afb3f34f760cb2d5dccdae7eae82bafb Mon Sep 17 00:00:00 2001 From: Peter Mitsis Date: Tue, 21 May 2024 10:39:22 -0400 Subject: [PATCH] kernel: Relax loop in z_smp_global_lock() Updates z_smp_global_lock() to follow the pattern used in spinlocks to relax the loop between atomic_cas() attempts. Signed-off-by: Peter Mitsis --- kernel/smp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/smp.c b/kernel/smp.c index 704bfcd9caa..a5659525278 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -60,6 +60,7 @@ unsigned int z_smp_global_lock(void) if (!_current->base.global_lock_count) { while (!atomic_cas(&global_lock, 0, 1)) { + arch_spin_relax(); } }