From c322fe4e1a9bcc20f7a2ded1ac0e1674ea282bc0 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 24 Mar 2011 23:05:17 -0400 Subject: optimize spinlock spin --- src/thread/pthread_spin_lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/thread') diff --git a/src/thread/pthread_spin_lock.c b/src/thread/pthread_spin_lock.c index 59fa6ea8..9e43f475 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 (a_xchg(s, 1)); + while (*s || a_xchg(s, 1)); return 0; } -- cgit v1.2.1