fix broken spinlock due to miscompilation
authorRich Felker <dalias@aerifal.cx>
Tue, 29 Mar 2011 02:22:54 +0000 (22:22 -0400)
committerRich Felker <dalias@aerifal.cx>
Tue, 29 Mar 2011 02:22:54 +0000 (22:22 -0400)
actually this trick also seems to have made the uncontended case slower.

src/thread/pthread_spin_lock.c

index 9e43f47..59fa6ea 100644 (file)
@@ -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;
 }