pthread_mutex_lock.c 210 B

12345678910
  1. #include "pthread_impl.h"
  2. int pthread_mutex_lock(pthread_mutex_t *m)
  3. {
  4. if ((m->_m_type&15) == PTHREAD_MUTEX_NORMAL
  5. && !a_cas(&m->_m_lock, 0, EBUSY))
  6. return 0;
  7. return pthread_mutex_timedlock(m, 0);
  8. }