Quellcode durchsuchen

fix broken spinlock due to miscompilation

actually this trick also seems to have made the uncontended case slower.
Rich Felker vor 14 Jahren
Ursprung
Commit
117581ca69
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      src/thread/pthread_spin_lock.c

+ 1 - 1
src/thread/pthread_spin_lock.c

@@ -2,6 +2,6 @@
 
 
 int pthread_spin_lock(pthread_spinlock_t *s)
 int pthread_spin_lock(pthread_spinlock_t *s)
 {
 {
-	while (*s || a_xchg(s, 1));
+	while (a_xchg(s, 1));
 	return 0;
 	return 0;
 }
 }