pthread_mutex_lock.c 200 B

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