1 #include "pthread_impl.h"
3 int pthread_mutex_unlock(pthread_mutex_t *m)
5 if (m->_m_type == PTHREAD_MUTEX_RECURSIVE) {
6 if (a_fetch_add(&m->_m_lock, -1)==1 && m->_m_waiters)
7 __wake(&m->_m_lock, 1, 0);
11 if (m->_m_type == PTHREAD_MUTEX_ERRORCHECK
12 && m->_m_owner != pthread_self()->tid)
17 if (m->_m_waiters) __wake(&m->_m_lock, 1, 0);