Browse Source

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>
pull/73191/head
Peter Mitsis 1 year ago committed by Anas Nashif
parent
commit
d082cd29af
  1. 1
      kernel/smp.c

1
kernel/smp.c

@ -60,6 +60,7 @@ unsigned int z_smp_global_lock(void) @@ -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();
}
}

Loading…
Cancel
Save