projects
/
musl
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
f860ec7163798ac34b5180f657cb9f4627285c86
[musl]
/
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->_rw_readers);
6
if (rw->_rw_wrlock) {
7
a_dec(&rw->_rw_readers);
8
if (rw->_rw_waiters && !rw->_rw_readers)
9
__wake(&rw->_rw_readers, 1, 0);
10
return EBUSY;
11
}
12
return 0;
13
}