begin unifying clone/thread management interface in preparation for porting
[oweals/musl.git] / 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->__lock, &m->__waiters, 1, 0);
8         return r;
9 }