Home | History | Annotate | Download | only in libpthread

Lines Matching refs:mtx

1 /*	$NetBSD: mtx.c,v 1.1 2019/04/24 11:43:19 kamil Exp $	*/
33 __RCSID("$NetBSD: mtx.c,v 1.1 2019/04/24 11:43:19 kamil Exp $");
41 mtx_destroy(mtx_t *mtx)
44 _DIAGASSERT(mtx != NULL);
49 (void)pthread_mutex_destroy(mtx);
53 mtx_init_default(mtx_t *mtx)
56 _DIAGASSERT(mtx != NULL);
58 if (pthread_mutex_init(mtx, NULL) != 0)
65 mtx_init_recursive(mtx_t *mtx)
69 _DIAGASSERT(mtx != NULL);
80 if (pthread_mutex_init(mtx, &attr) == 0)
89 mtx_init(mtx_t *mtx, int type)
92 _DIAGASSERT(mtx != NULL);
97 return mtx_init_default(mtx);
100 return mtx_init_recursive(mtx);
107 mtx_lock(mtx_t *mtx)
110 _DIAGASSERT(mtx != NULL);
112 if (pthread_mutex_lock(mtx) == 0)
119 mtx_timedlock(mtx_t *__restrict mtx, const struct timespec *__restrict ts)
122 _DIAGASSERT(mtx != NULL);
125 switch(pthread_mutex_timedlock(mtx, ts)) {
136 mtx_trylock(mtx_t *mtx)
139 _DIAGASSERT(mtx != NULL);
141 switch(pthread_mutex_trylock(mtx)) {
152 mtx_unlock(mtx_t *mtx)
155 _DIAGASSERT(mtx != NULL);
157 if (pthread_mutex_unlock(mtx) == 0)