From: Rich Felker Date: Tue, 29 Mar 2011 02:22:54 +0000 (-0400) Subject: fix broken spinlock due to miscompilation X-Git-Tag: v0.7.5~33 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=117581ca69ec2a9c341390eed353646b47a512df;p=oweals%2Fmusl.git fix broken spinlock due to miscompilation actually this trick also seems to have made the uncontended case slower. --- diff --git a/src/thread/pthread_spin_lock.c b/src/thread/pthread_spin_lock.c index 9e43f475..59fa6ea8 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 (*s || a_xchg(s, 1)); + while (a_xchg(s, 1)); return 0; }