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:
parent
0f56974c9d
commit
d082cd29af
1 changed files with 1 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue