Lines Matching refs:mtx
135 static inline int mtx_init(mtx_t *mtx, int type) in mtx_init() argument
139 if (!mtx || type != mtx_plain) in mtx_init()
142 errcode = pthread_mutex_init(&mtx->mutex, NULL); in mtx_init()
149 static inline void mtx_destroy(mtx_t *mtx) in mtx_destroy() argument
151 if (mtx) in mtx_destroy()
152 (void) pthread_mutex_destroy(&mtx->mutex); in mtx_destroy()
155 static inline int mtx_lock(mtx_t *mtx) in mtx_lock() argument
159 if (!mtx) in mtx_lock()
162 errcode = pthread_mutex_lock(&mtx->mutex); in mtx_lock()
169 static inline int mtx_unlock(mtx_t *mtx) in mtx_unlock() argument
173 if (!mtx) in mtx_unlock()
176 errcode = pthread_mutex_unlock(&mtx->mutex); in mtx_unlock()
245 static inline int cnd_wait(cnd_t *cnd, mtx_t *mtx) in cnd_wait() argument
249 if (!cnd || !mtx) in cnd_wait()
252 errcode = pthread_cond_wait(&cnd->cond, &mtx->mutex); in cnd_wait()