Lines Matching refs:rwlock

67 int __thr_rwlock_rdlock(struct urwlock *rwlock, int flags,
69 int __thr_rwlock_wrlock(struct urwlock *rwlock,
71 int __thr_rwlock_unlock(struct urwlock *rwlock) __hidden;
74 void _thr_rwl_rdlock(struct urwlock *rwlock) __hidden;
75 void _thr_rwl_wrlock(struct urwlock *rwlock) __hidden;
76 void _thr_rwl_unlock(struct urwlock *rwlock) __hidden;
184 _thr_rwlock_tryrdlock(struct urwlock *rwlock, int flags) in _thr_rwlock_tryrdlock() argument
189 (rwlock->rw_flags & URWLOCK_PREFER_READER) != 0) in _thr_rwlock_tryrdlock()
193 state = rwlock->rw_state; in _thr_rwlock_tryrdlock()
198 if (atomic_cmpset_acq_32(&rwlock->rw_state, state, state + 1)) in _thr_rwlock_tryrdlock()
200 state = rwlock->rw_state; in _thr_rwlock_tryrdlock()
207 _thr_rwlock_trywrlock(struct urwlock *rwlock) in _thr_rwlock_trywrlock() argument
211 state = rwlock->rw_state; in _thr_rwlock_trywrlock()
214 if (atomic_cmpset_acq_32(&rwlock->rw_state, state, in _thr_rwlock_trywrlock()
217 state = rwlock->rw_state; in _thr_rwlock_trywrlock()
224 _thr_rwlock_rdlock(struct urwlock *rwlock, int flags, struct timespec *tsp) in _thr_rwlock_rdlock() argument
227 if (_thr_rwlock_tryrdlock(rwlock, flags) == 0) in _thr_rwlock_rdlock()
229 return (__thr_rwlock_rdlock(rwlock, flags, tsp)); in _thr_rwlock_rdlock()
233 _thr_rwlock_wrlock(struct urwlock *rwlock, struct timespec *tsp) in _thr_rwlock_wrlock() argument
236 if (_thr_rwlock_trywrlock(rwlock) == 0) in _thr_rwlock_wrlock()
238 return (__thr_rwlock_wrlock(rwlock, tsp)); in _thr_rwlock_wrlock()
242 _thr_rwlock_unlock(struct urwlock *rwlock) in _thr_rwlock_unlock() argument
246 state = rwlock->rw_state; in _thr_rwlock_unlock()
248 if (atomic_cmpset_rel_32(&rwlock->rw_state, in _thr_rwlock_unlock()
258 if (atomic_cmpset_rel_32(&rwlock->rw_state, in _thr_rwlock_unlock()
261 state = rwlock->rw_state; in _thr_rwlock_unlock()
267 return (__thr_rwlock_unlock(rwlock)); in _thr_rwlock_unlock()