projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
begin unifying clone/thread management interface in preparation for porting
[oweals/musl.git]
/
src
/
thread
/
pthread_rwlock_tryrdlock.c
1
#include "pthread_impl.h"
2
3
int pthread_rwlock_tryrdlock(pthread_rwlock_t *rw)
4
{
5
a_inc(&rw->__readers);
6
if (rw->__wrlock) {
7
a_dec(&rw->__readers);
8
if (rw->__waiters && !rw->__readers)
9
__wake(&rw->__readers, 1, 0);
10
return EAGAIN;
11
}
12
return 0;
13
}