Lines Matching defs:mtx

43 _thr_umutex_init(struct umutex *mtx)
47 *mtx = default_mtx;
58 __thr_umutex_lock(struct umutex *mtx, uint32_t id)
62 if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) {
65 _umtx_op_err(mtx, UMTX_OP_MUTEX_WAIT, 0, 0, 0);
67 owner = mtx->m_owner;
69 atomic_cmpset_acq_32(&mtx->m_owner, owner, id|owner))
74 return _umtx_op_err(mtx, UMTX_OP_MUTEX_LOCK, 0, 0, 0);
80 __thr_umutex_lock_spin(struct umutex *mtx, uint32_t id)
85 return __thr_umutex_lock(mtx, id);
87 if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) {
91 owner = mtx->m_owner;
94 &mtx->m_owner,
103 _umtx_op_err(mtx, UMTX_OP_MUTEX_WAIT, 0, 0, 0);
107 return _umtx_op_err(mtx, UMTX_OP_MUTEX_LOCK, 0, 0, 0);
111 __thr_umutex_timedlock(struct umutex *mtx, uint32_t id,
131 if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) {
134 ret = _umtx_op_err(mtx, UMTX_OP_MUTEX_WAIT, 0,
138 owner = mtx->m_owner;
140 atomic_cmpset_acq_32(&mtx->m_owner, owner, id|owner))
143 ret = _umtx_op_err(mtx, UMTX_OP_MUTEX_LOCK, 0,
155 __thr_umutex_unlock(struct umutex *mtx, uint32_t id)
157 return _umtx_op_err(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0);
161 __thr_umutex_trylock(struct umutex *mtx)
163 return _umtx_op_err(mtx, UMTX_OP_MUTEX_TRYLOCK, 0, 0, 0);
167 __thr_umutex_set_ceiling(struct umutex *mtx, uint32_t ceiling,
170 return _umtx_op_err(mtx, UMTX_OP_SET_CEILING, ceiling, oldceiling, 0);
174 _thr_umtx_wait(volatile long *mtx, long id, const struct timespec *timeout)
179 return _umtx_op_err(__DEVOLATILE(void *, mtx), UMTX_OP_WAIT, id, 0,
184 _thr_umtx_wait_uint(volatile u_int *mtx, u_int id, const struct timespec *timeout, int shared)
189 return _umtx_op_err(__DEVOLATILE(void *, mtx),
195 _thr_umtx_timedwait_uint(volatile u_int *mtx, u_int id, int clockid,
212 return _umtx_op_err(__DEVOLATILE(void *, mtx),
218 _thr_umtx_wake(volatile void *mtx, int nr_wakeup, int shared)
220 return _umtx_op_err(__DEVOLATILE(void *, mtx), shared ? UMTX_OP_WAKE : UMTX_OP_WAKE_PRIVATE,