mirror of
https://github.com/fluencelabs/musl
synced 2025-06-28 22:22:01 +00:00
initial check-in, version 0.5.0
This commit is contained in:
9
src/thread/pthread_mutex_lock.c
Normal file
9
src/thread/pthread_mutex_lock.c
Normal file
@ -0,0 +1,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;
|
||||
}
|
Reference in New Issue
Block a user