diff --git a/src/system/libroot/posix/pthread/pthread_spinlock.c b/src/system/libroot/posix/pthread/pthread_spinlock.c index d9881feb7a..0814061a4c 100644 --- a/src/system/libroot/posix/pthread/pthread_spinlock.c +++ b/src/system/libroot/posix/pthread/pthread_spinlock.c @@ -5,6 +5,9 @@ #include + +#include + #include "pthread_private.h" @@ -35,7 +38,8 @@ int pthread_spin_lock(pthread_spinlock_t* lock) { while (atomic_test_and_set((int32*)&lock->lock, LOCKED, UNLOCKED) == LOCKED) - ; // spin + SPINLOCK_PAUSE(); // spin + // TODO: On UP machines we should thread_yield() in the loop. return 0; }