Skip to content

Commit d082cd2

Browse files
peter-mitsisnashif
authored andcommitted
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 <[email protected]>
1 parent 0f56974 commit d082cd2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/smp.c

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ unsigned int z_smp_global_lock(void)
6060

6161
if (!_current->base.global_lock_count) {
6262
while (!atomic_cas(&global_lock, 0, 1)) {
63+
arch_spin_relax();
6364
}
6465
}
6566

0 commit comments

Comments
 (0)