X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_spin_trylock.c;h=59de695ddad9ebb4ad941574681829513fe321db;hb=062446a85db9b58b4900df82e17cb8c07ec50453;hp=1fc5f73c174ec890da1457bb8bd776f9e1fb3bc2;hpb=b8b85a42729dc96e43d51848823fbe28ad92b5c0;p=musl diff --git a/src/thread/pthread_spin_trylock.c b/src/thread/pthread_spin_trylock.c index 1fc5f73c..59de695d 100644 --- a/src/thread/pthread_spin_trylock.c +++ b/src/thread/pthread_spin_trylock.c @@ -2,6 +2,5 @@ int pthread_spin_trylock(pthread_spinlock_t *s) { - if (*s || a_xchg(s, 1)) return EBUSY; - return 0; + return -a_swap(s, 1) & EBUSY; }