summaryrefslogtreecommitdiff
path: root/src/thread/pthread_mutex_lock.c
blob: 6696f17a234b7e571ed8ae5210fc273c2b0ad8db (plain)
1
2
3
4
5
6
7
8
9
#include "pthread_impl.h"

int pthread_mutex_lock(pthread_mutex_t *m)
{
	int r;
	while ((r=pthread_mutex_trylock(m)) == EBUSY)
		__wait(&m->__lock, &m->__waiters, 1, 0);
	return r;
}