reorganize pthread data structures and move the definitions to alltypes.h
[musl] / src / thread / pthread_mutex_lock.c
1 #include "pthread_impl.h"
2
3 int pthread_mutex_lock(pthread_mutex_t *m)
4 {
5         int r;
6         while ((r=pthread_mutex_trylock(m)) == EBUSY)
7                 __wait(&m->_m_lock, &m->_m_waiters, 1, 0);
8         return r;
9 }