initial check-in, version 0.5.0
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
#include "pthread_impl.h"
|
||||
|
||||
int pthread_rwlock_tryrdlock(pthread_rwlock_t *rw)
|
||||
{
|
||||
a_inc(&rw->__readers);
|
||||
if (rw->__wrlock) {
|
||||
a_dec(&rw->__readers);
|
||||
if (rw->__waiters && !rw->__readers)
|
||||
__wake(&rw->__readers, 1, 0);
|
||||
return EAGAIN;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user