Browse Source

optimize spinlock spin

Rich Felker 14 years ago
parent
commit
c322fe4e1a
1 changed files with 1 additions and 1 deletions
  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)
 {
-	while (a_xchg(s, 1));
+	while (*s || a_xchg(s, 1));
 	return 0;
 }