0db976ab3570ec6319a6474a687d093f189c94c1
[musl] / src / thread / pthread_mutex_consistent.c
1 #include "pthread_impl.h"
2
3 int pthread_mutex_consistent(pthread_mutex_t *m)
4 {
5         if (!(m->_m_type & 8)) return EINVAL;
6         if ((m->_m_lock & 0x7fffffff) != __pthread_self()->tid)
7                 return EPERM;
8         m->_m_type -= 8;
9         return 0;
10 }