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