X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_spin_lock.c;h=ded2b653c4751db88f288af6b84f92a7341263b3;hb=b4712ba445a5cb589d1ac37785c29164cd3cf1f9;hp=df575f0858681b76afb8895478778b67e8ca2a7b;hpb=2b71a4d1dfb0487cc2558df646a262ffb8261585;p=musl diff --git a/src/thread/pthread_spin_lock.c b/src/thread/pthread_spin_lock.c index df575f08..ded2b653 100644 --- a/src/thread/pthread_spin_lock.c +++ b/src/thread/pthread_spin_lock.c @@ -1,7 +1,8 @@ #include "pthread_impl.h" +#include int pthread_spin_lock(pthread_spinlock_t *s) { - while (a_swap(s, 1)) a_spin(); + while (*(volatile int *)s || a_cas(s, 0, EBUSY)) a_spin(); return 0; }