From: Rich Felker Date: Fri, 25 Mar 2011 03:05:17 +0000 (-0400) Subject: optimize spinlock spin X-Git-Tag: v0.7.5~44 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c322fe4e1a9bcc20f7a2ded1ac0e1674ea282bc0;p=oweals%2Fmusl.git optimize spinlock spin --- diff --git a/src/thread/pthread_spin_lock.c b/src/thread/pthread_spin_lock.c index 59fa6ea8..9e43f475 100644 --- a/src/thread/pthread_spin_lock.c +++ b/src/thread/pthread_spin_lock.c @@ -2,6 +2,6 @@ int pthread_spin_lock(pthread_spinlock_t *s) { - while (a_xchg(s, 1)); + while (*s || a_xchg(s, 1)); return 0; }