diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-10-03 00:11:16 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-10-03 00:11:16 -0400 |
commit | b8688ff87574fad6b3056443a5385010952fb243 (patch) | |
tree | 7df75ffc26a4ea088ed100bd03309326bdbfce20 /src/thread | |
parent | 7fe58d3511387ab6c57909f6e4baef58acd6bd56 (diff) | |
download | musl-b8688ff87574fad6b3056443a5385010952fb243.tar.gz musl-b8688ff87574fad6b3056443a5385010952fb243.tar.bz2 musl-b8688ff87574fad6b3056443a5385010952fb243.tar.xz musl-b8688ff87574fad6b3056443a5385010952fb243.zip |
fix crash if pthread_mutex_unlock is called without ever locking
this is valid for error-checking mutexes; otherwise it invokes UB and
would be justified in crashing.
Diffstat (limited to 'src/thread')
-rw-r--r-- | src/thread/pthread_mutex_unlock.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/thread/pthread_mutex_unlock.c b/src/thread/pthread_mutex_unlock.c index 05baec18..6950872b 100644 --- a/src/thread/pthread_mutex_unlock.c +++ b/src/thread/pthread_mutex_unlock.c @@ -9,7 +9,7 @@ int pthread_mutex_unlock(pthread_mutex_t *m) if (m->_m_type != PTHREAD_MUTEX_NORMAL) { if (!m->_m_lock) return EPERM; - self = __pthread_self(); + self = pthread_self(); if ((m->_m_lock&0x1fffffff) != self->tid) return EPERM; if ((m->_m_type&3) == PTHREAD_MUTEX_RECURSIVE && m->_m_count) |