pthread_mutex_consistent.c 223 B

12345678910
  1. #include "pthread_impl.h"
  2. int pthread_mutex_consistent(pthread_mutex_t *m)
  3. {
  4. if (!(m->_m_type & 8)) return EINVAL;
  5. if ((m->_m_lock & 0x7fffffff) != __pthread_self()->tid)
  6. return EPERM;
  7. m->_m_type &= ~8U;
  8. return 0;
  9. }