LibC: Use pause in pthread spinlock locking

This commit is contained in:
2025-06-16 15:07:58 +03:00
parent 5e4e174d61
commit f9451915b9

View File

@@ -648,7 +648,11 @@ int pthread_spin_lock(pthread_spinlock_t* lock)
pthread_t expected = 0;
while (!BAN::atomic_compare_exchange(*lock, expected, tid, BAN::MemoryOrder::memory_order_acquire))
{
__builtin_ia32_pause();
expected = 0;
}
return 0;
}