blob: f59fbbdd04a3bfe39ee94d6dbd80f2ab558f9bff (
plain) (
tree)
|
|
#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;
}
|