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 <peter.mitsis@intel.com>
This commit is contained in:
Peter Mitsis 2024-05-21 10:39:22 -04:00 committed by Anas Nashif
commit d082cd29af

View file

@ -60,6 +60,7 @@ unsigned int z_smp_global_lock(void)
if (!_current->base.global_lock_count) { if (!_current->base.global_lock_count) {
while (!atomic_cas(&global_lock, 0, 1)) { while (!atomic_cas(&global_lock, 0, 1)) {
arch_spin_relax();
} }
} }