1 #include "pthread_impl.h"
3 int pthread_mutex_unlock(pthread_mutex_t *m)
7 if (m->_m_type != PTHREAD_MUTEX_NORMAL) {
8 self = __pthread_self();
9 if ((m->_m_lock&0x1fffffff) != self->tid)
11 if ((m->_m_type&3) == PTHREAD_MUTEX_RECURSIVE && --m->_m_count)
13 if (m->_m_type >= 4) {
14 self->robust_list.pending = &m->_m_next;
15 *(void **)m->_m_prev = m->_m_next;
16 if (m->_m_next) ((void **)m->_m_next)[-1] = m->_m_prev;
21 if (m->_m_waiters) __wake(&m->_m_lock, 1, 0);
22 if (m->_m_type >= 4) self->robust_list.pending = 0;