summaryrefslogtreecommitdiff
path: root/src/thread/pthread_mutex_lock.c
blob: 15ede3f5abdbe75edac86fdfd6ae8da7688bf472 (plain) (blame)
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->_m_lock, &m->_m_waiters, 1, 0);
	return r;
}