diff options
author | Rich Felker <dalias@aerifal.cx> | 2019-03-29 15:49:14 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2019-03-29 15:49:14 -0400 |
commit | 2142cafdc7692428b5f993fe211279d1ed2e7271 (patch) | |
tree | da35f800b9c881471e3c8ce4843605dd7d563c65 /src | |
parent | 54316a52b2119edf73e274c8b4f25d7757f7b4d3 (diff) | |
download | musl-2142cafdc7692428b5f993fe211279d1ed2e7271.tar.gz |
clean up access to mutex type in pthread_mutex_trylock
there was no point in masking off the pshared bit when first loading
the type, since every subsequent access involves a mask anyway. not
masking it may avoid a subsequent load to check the pshared flag, and
it's just simpler.
Diffstat (limited to 'src')
-rw-r--r-- | src/thread/pthread_mutex_trylock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/thread/pthread_mutex_trylock.c b/src/thread/pthread_mutex_trylock.c index 3fe59127..29622ff9 100644 --- a/src/thread/pthread_mutex_trylock.c +++ b/src/thread/pthread_mutex_trylock.c @@ -3,7 +3,7 @@ int __pthread_mutex_trylock_owner(pthread_mutex_t *m) { int old, own; - int type = m->_m_type & 15; + int type = m->_m_type; pthread_t self = __pthread_self(); int tid = self->tid; @@ -17,7 +17,7 @@ int __pthread_mutex_trylock_owner(pthread_mutex_t *m) if (own == 0x3fffffff) return ENOTRECOVERABLE; if (own || (old && !(type & 4))) return EBUSY; - if (m->_m_type & 128) { + if (type & 128) { if (!self->robust_list.off) { self->robust_list.off = (char*)&m->_m_lock-(char *)&m->_m_next; __syscall(SYS_set_robust_list, &self->robust_list, 3*sizeof(long)); |