summaryrefslogtreecommitdiff
path: root/src/thread/pthread_mutex_trylock.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-03-29 15:11:25 -0400
committerRich Felker <dalias@aerifal.cx>2011-03-29 15:11:25 -0400
commit8524d6536c7bcb893115c0c48982c7311906c1db (patch)
treec7b3e919226555d9f91d60f2c85412eb0bf5df22 /src/thread/pthread_mutex_trylock.c
parent80c4dcd2535a2d7f01eb539b0358dc51b0c0e122 (diff)
downloadmusl-8524d6536c7bcb893115c0c48982c7311906c1db.tar.gz
revert mutex "optimization" that turned out to be worse
Diffstat (limited to 'src/thread/pthread_mutex_trylock.c')
-rw-r--r--src/thread/pthread_mutex_trylock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/thread/pthread_mutex_trylock.c b/src/thread/pthread_mutex_trylock.c
index 232e172b..50a815a5 100644
--- a/src/thread/pthread_mutex_trylock.c
+++ b/src/thread/pthread_mutex_trylock.c
@@ -7,7 +7,7 @@ int pthread_mutex_trylock(pthread_mutex_t *m)
pthread_t self;
if (m->_m_type == PTHREAD_MUTEX_NORMAL)
- return (m->_m_lock || a_swap(&m->_m_lock, 1)) ? EBUSY : 0;
+ return -a_swap(&m->_m_lock, 1) & EBUSY;
self = pthread_self();
tid = self->tid | 0x80000000;