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