Lines Matching refs:mtx
115 cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *abs_time)
119 assert(mtx != NULL);
123 rt = pthread_cond_timedwait(cond, mtx, abs_time);
131 cnd_wait(cnd_t *cond, mtx_t *mtx)
133 assert(mtx != NULL);
135 return (pthread_cond_wait(cond, mtx) == 0) ? thrd_success : thrd_error;
142 mtx_destroy(mtx_t *mtx)
144 assert(mtx != NULL);
145 pthread_mutex_destroy(mtx);
176 mtx_init(mtx_t *mtx, int type)
179 assert(mtx != NULL);
187 pthread_mutex_init(mtx, NULL);
193 pthread_mutex_init(mtx, &attr);
200 mtx_lock(mtx_t *mtx)
202 assert(mtx != NULL);
203 return (pthread_mutex_lock(mtx) == 0) ? thrd_success : thrd_error;
208 mtx_timedlock(mtx_t *mtx, const struct timespec *ts)
210 assert(mtx != NULL);
216 rt = pthread_mutex_timedlock(mtx, ts);
223 while (mtx_trylock(mtx) != thrd_success) {
237 mtx_trylock(mtx_t *mtx)
239 assert(mtx != NULL);
240 return (pthread_mutex_trylock(mtx) == 0) ? thrd_success : thrd_busy;
245 mtx_unlock(mtx_t *mtx)
247 assert(mtx != NULL);
248 return (pthread_mutex_unlock(mtx) == 0) ? thrd_success : thrd_error;