1 #include "pthread_impl.h"
3 int pthread_rwlock_unlock(pthread_rwlock_t *rw)
5 struct pthread *self = pthread_self();
6 if (rw->__owner == self->tid) {
8 a_store(&rw->__wrlock, 0);
10 __wake(&rw->__wrlock, -1, 0);
13 a_dec(&rw->__readers);
14 if (rw->__waiters && !rw->__readers)
15 __wake(&rw->__readers, 1, 0);