optimize spinlock spin
authorRich Felker <dalias@aerifal.cx>
Fri, 25 Mar 2011 03:05:17 +0000 (23:05 -0400)
committerRich Felker <dalias@aerifal.cx>
Fri, 25 Mar 2011 03:05:17 +0000 (23:05 -0400)
src/thread/pthread_spin_lock.c

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