projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7fe58d3
)
fix crash if pthread_mutex_unlock is called without ever locking
author
Rich Felker
<dalias@aerifal.cx>
Mon, 3 Oct 2011 04:11:16 +0000
(
00:11
-0400)
committer
Rich Felker
<dalias@aerifal.cx>
Mon, 3 Oct 2011 04:11:16 +0000
(
00:11
-0400)
this is valid for error-checking mutexes; otherwise it invokes UB and
would be justified in crashing.
src/thread/pthread_mutex_unlock.c
patch
|
blob
|
history
diff --git
a/src/thread/pthread_mutex_unlock.c
b/src/thread/pthread_mutex_unlock.c
index 05baec18dd13a3c5ac8e43077f082f2671526b90..6950872b5860187c9ce8bb7e277b95d9980e32b4 100644
(file)
--- 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)