From 4106cdcd2de34bf3b9839e042344d92eae887ecb Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 28 Mar 2011 22:36:55 -0400 Subject: revert some more spin optimizations that turned out to be pessimizations --- src/thread/pthread_spin_trylock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/thread/pthread_spin_trylock.c') diff --git a/src/thread/pthread_spin_trylock.c b/src/thread/pthread_spin_trylock.c index 1fc5f73c..c12696b3 100644 --- a/src/thread/pthread_spin_trylock.c +++ b/src/thread/pthread_spin_trylock.c @@ -2,6 +2,5 @@ int pthread_spin_trylock(pthread_spinlock_t *s) { - if (*s || a_xchg(s, 1)) return EBUSY; - return 0; + return -a_xchg(s, 1) & EBUSY; } -- cgit v1.2.1