Lines Matching defs:mtx
64 simple_mtx_init(simple_mtx_t *mtx, MAYBE_UNUSED int type)
68 mtx->val = 0;
72 simple_mtx_destroy(UNUSED simple_mtx_t *mtx)
77 simple_mtx_lock(simple_mtx_t *mtx)
81 c = __sync_val_compare_and_swap(&mtx->val, 0, 1);
84 c = __sync_lock_test_and_set(&mtx->val, 2);
86 futex_wait(&mtx->val, 2, NULL);
87 c = __sync_lock_test_and_set(&mtx->val, 2);
93 simple_mtx_unlock(simple_mtx_t *mtx)
97 c = __sync_fetch_and_sub(&mtx->val, 1);
99 mtx->val = 0;
100 futex_wake(&mtx->val, 1);
111 simple_mtx_init(simple_mtx_t *mtx, int type)
113 mtx_init(mtx, type);
117 simple_mtx_destroy(simple_mtx_t *mtx)
119 mtx_destroy(mtx);
123 simple_mtx_lock(simple_mtx_t *mtx)
125 mtx_lock(mtx);
129 simple_mtx_unlock(simple_mtx_t *mtx)
131 mtx_unlock(mtx);