projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add ptsname_r (nonstandard) and split ptsname (standard) to separate file
[musl]
/
src
/
thread
/
pthread_mutex_unlock.c
diff --git
a/src/thread/pthread_mutex_unlock.c
b/src/thread/pthread_mutex_unlock.c
index
5855db0
..
6c4d7f2
100644
(file)
--- a/
src/thread/pthread_mutex_unlock.c
+++ b/
src/thread/pthread_mutex_unlock.c
@@
-5,9
+5,11
@@
int pthread_mutex_unlock(pthread_mutex_t *m)
pthread_t self;
if (m->_m_type != PTHREAD_MUTEX_NORMAL) {
pthread_t self;
if (m->_m_type != PTHREAD_MUTEX_NORMAL) {
+ if (!m->_m_lock)
+ return EPERM;
self = __pthread_self();
if ((m->_m_lock&0x1fffffff) != self->tid)
self = __pthread_self();
if ((m->_m_lock&0x1fffffff) != self->tid)
- return EPERM;
+ return EPERM;
if ((m->_m_type&3) == PTHREAD_MUTEX_RECURSIVE && --m->_m_count)
return 0;
if (m->_m_type >= 4) {
if ((m->_m_type&3) == PTHREAD_MUTEX_RECURSIVE && --m->_m_count)
return 0;
if (m->_m_type >= 4) {