Lines Matching refs:mtx

33 _thr_umutex_init(struct umutex *mtx)  in _thr_umutex_init()  argument
37 *mtx = default_mtx; in _thr_umutex_init()
49 __thr_umutex_lock(struct umutex *mtx, uint32_t id) in __thr_umutex_lock() argument
53 if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) != 0) in __thr_umutex_lock()
54 return (_umtx_op_err(mtx, UMTX_OP_MUTEX_LOCK, 0, 0, 0)); in __thr_umutex_lock()
57 owner = mtx->m_owner; in __thr_umutex_lock()
59 atomic_cmpset_acq_32(&mtx->m_owner, owner, id | owner)) in __thr_umutex_lock()
62 atomic_cmpset_acq_32(&mtx->m_owner, owner, in __thr_umutex_lock()
69 _umtx_op_err(mtx, UMTX_OP_MUTEX_WAIT, 0, 0, 0); in __thr_umutex_lock()
76 __thr_umutex_lock_spin(struct umutex *mtx, uint32_t id) in __thr_umutex_lock_spin() argument
82 return (__thr_umutex_lock(mtx, id)); in __thr_umutex_lock_spin()
83 if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) != 0) in __thr_umutex_lock_spin()
84 return (_umtx_op_err(mtx, UMTX_OP_MUTEX_LOCK, 0, 0, 0)); in __thr_umutex_lock_spin()
89 owner = mtx->m_owner; in __thr_umutex_lock_spin()
91 atomic_cmpset_acq_32(&mtx->m_owner, owner, in __thr_umutex_lock_spin()
95 atomic_cmpset_acq_32(&mtx->m_owner, owner, in __thr_umutex_lock_spin()
104 _umtx_op_err(mtx, UMTX_OP_MUTEX_WAIT, 0, 0, 0); in __thr_umutex_lock_spin()
109 __thr_umutex_timedlock(struct umutex *mtx, uint32_t id, in __thr_umutex_timedlock() argument
129 if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | in __thr_umutex_timedlock()
132 owner = mtx->m_owner; in __thr_umutex_timedlock()
134 atomic_cmpset_acq_32(&mtx->m_owner, owner, in __thr_umutex_timedlock()
138 atomic_cmpset_acq_32(&mtx->m_owner, owner, in __thr_umutex_timedlock()
144 ret = _umtx_op_err(mtx, UMTX_OP_MUTEX_WAIT, 0, in __thr_umutex_timedlock()
147 ret = _umtx_op_err(mtx, UMTX_OP_MUTEX_LOCK, 0, in __thr_umutex_timedlock()
160 __thr_umutex_unlock(struct umutex *mtx) in __thr_umutex_unlock() argument
163 return (_umtx_op_err(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0)); in __thr_umutex_unlock()
167 __thr_umutex_trylock(struct umutex *mtx) in __thr_umutex_trylock() argument
170 return (_umtx_op_err(mtx, UMTX_OP_MUTEX_TRYLOCK, 0, 0, 0)); in __thr_umutex_trylock()
174 __thr_umutex_set_ceiling(struct umutex *mtx, uint32_t ceiling, in __thr_umutex_set_ceiling() argument
178 return (_umtx_op_err(mtx, UMTX_OP_SET_CEILING, ceiling, oldceiling, 0)); in __thr_umutex_set_ceiling()
182 _thr_umtx_wait(volatile long *mtx, long id, const struct timespec *timeout) in _thr_umtx_wait() argument
188 return (_umtx_op_err(__DEVOLATILE(void *, mtx), UMTX_OP_WAIT, id, 0, in _thr_umtx_wait()
193 _thr_umtx_wait_uint(volatile u_int *mtx, u_int id, in _thr_umtx_wait_uint() argument
200 return (_umtx_op_err(__DEVOLATILE(void *, mtx), shared ? in _thr_umtx_wait_uint()
206 _thr_umtx_timedwait_uint(volatile u_int *mtx, u_int id, int clockid, in _thr_umtx_timedwait_uint() argument
223 return (_umtx_op_err(__DEVOLATILE(void *, mtx), shared ? in _thr_umtx_timedwait_uint()
229 _thr_umtx_wake(volatile void *mtx, int nr_wakeup, int shared) in _thr_umtx_wake() argument
232 return (_umtx_op_err(__DEVOLATILE(void *, mtx), shared ? in _thr_umtx_wake()