Lines Matching refs:mtx

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