Lines Matching refs:mtx
135 cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *abs_time)
139 assert(mtx != NULL);
143 rt = pthread_cond_timedwait(cond, mtx, abs_time);
151 cnd_wait(cnd_t *cond, mtx_t *mtx)
153 assert(mtx != NULL);
155 return (pthread_cond_wait(cond, mtx) == 0) ? thrd_success : thrd_error;
162 mtx_destroy(mtx_t *mtx)
164 assert(mtx != NULL);
165 pthread_mutex_destroy(mtx);
196 mtx_init(mtx_t *mtx, int type)
199 assert(mtx != NULL);
207 pthread_mutex_init(mtx, NULL);
213 pthread_mutex_init(mtx, &attr);
220 mtx_lock(mtx_t *mtx)
222 assert(mtx != NULL);
223 return (pthread_mutex_lock(mtx) == 0) ? thrd_success : thrd_error;
227 mtx_trylock(mtx_t *mtx);
234 mtx_timedlock(mtx_t *mtx, const struct timespec *ts)
236 assert(mtx != NULL);
242 rt = pthread_mutex_timedlock(mtx, ts);
249 while (mtx_trylock(mtx) != thrd_success) {
263 mtx_trylock(mtx_t *mtx)
265 assert(mtx != NULL);
266 return (pthread_mutex_trylock(mtx) == 0) ? thrd_success : thrd_busy;
271 mtx_unlock(mtx_t *mtx)
273 assert(mtx != NULL);
274 return (pthread_mutex_unlock(mtx) == 0) ? thrd_success : thrd_error;