diff --git a/src/system/libroot/posix/pthread/pthread_spinlock.c b/src/system/libroot/posix/pthread/pthread_spinlock.c index 0814061a4c..b0167b53f7 100644 --- a/src/system/libroot/posix/pthread/pthread_spinlock.c +++ b/src/system/libroot/posix/pthread/pthread_spinlock.c @@ -18,7 +18,7 @@ int pthread_spin_init(pthread_spinlock_t* lock, int pshared) { - // this implementation of spinlocks doesn't differentiate + // This implementation of spinlocks doesn't differentiate // between spin locks used by threads in the same process or // between threads of different processes. @@ -37,9 +37,11 @@ pthread_spin_destroy(pthread_spinlock_t* lock) int pthread_spin_lock(pthread_spinlock_t* lock) { - while (atomic_test_and_set((int32*)&lock->lock, LOCKED, UNLOCKED) == LOCKED) + while (atomic_test_and_set((int32*)&lock->lock, LOCKED, UNLOCKED) + == LOCKED) { SPINLOCK_PAUSE(); // spin // TODO: On UP machines we should thread_yield() in the loop. + } return 0; }