Lines Matching refs:mtx
20 static void __mutex_init(struct mutex *mtx, bool pshared) in __mutex_init() argument
33 CHECK_ERR(pthread_mutex_init(&mtx->lock, &attr)); in __mutex_init()
37 void mutex_init(struct mutex *mtx) in mutex_init() argument
39 __mutex_init(mtx, /*pshared=*/false); in mutex_init()
42 void mutex_init_pshared(struct mutex *mtx) in mutex_init_pshared() argument
44 __mutex_init(mtx, /*pshared=*/true); in mutex_init_pshared()
47 void mutex_destroy(struct mutex *mtx) in mutex_destroy() argument
49 CHECK_ERR(pthread_mutex_destroy(&mtx->lock)); in mutex_destroy()
52 void mutex_lock(struct mutex *mtx) in mutex_lock() argument
55 CHECK_ERR(pthread_mutex_lock(&mtx->lock)); in mutex_lock()
58 void mutex_unlock(struct mutex *mtx) in mutex_unlock() argument
61 CHECK_ERR(pthread_mutex_unlock(&mtx->lock)); in mutex_unlock()
64 bool mutex_trylock(struct mutex *mtx) in mutex_trylock() argument
66 int ret = pthread_mutex_trylock(&mtx->lock); in mutex_trylock()
106 void cond_wait(struct cond *cnd, struct mutex *mtx) in cond_wait() argument
108 CHECK_ERR(pthread_cond_wait(&cnd->cond, &mtx->lock)); in cond_wait()