diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-03-29 15:11:25 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-03-29 15:11:25 -0400 |
commit | 8524d6536c7bcb893115c0c48982c7311906c1db (patch) | |
tree | c7b3e919226555d9f91d60f2c85412eb0bf5df22 /src/thread | |
parent | 80c4dcd2535a2d7f01eb539b0358dc51b0c0e122 (diff) | |
download | musl-8524d6536c7bcb893115c0c48982c7311906c1db.tar.gz musl-8524d6536c7bcb893115c0c48982c7311906c1db.tar.bz2 musl-8524d6536c7bcb893115c0c48982c7311906c1db.tar.xz musl-8524d6536c7bcb893115c0c48982c7311906c1db.zip |
revert mutex "optimization" that turned out to be worse
Diffstat (limited to 'src/thread')
-rw-r--r-- | src/thread/pthread_mutex_trylock.c | 2 |
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; |