Lines Matching refs:mtx
8 mtx_init(mtx_t *mtx) in mtx_init() argument
12 if (!InitializeCriticalSectionAndSpinCount(&mtx->lock, _CRT_SPINCOUNT)) in mtx_init()
15 mtx->lock = 0; in mtx_init()
22 if (pthread_mutex_init(&mtx->lock, &attr) != 0) { in mtx_init()
32 mtx_fini(mtx_t *mtx) in mtx_fini() argument
38 pthread_mutex_destroy(&mtx->lock); in mtx_fini()
43 mtx_lock(mtx_t *mtx) in mtx_lock() argument
47 EnterCriticalSection(&mtx->lock); in mtx_lock()
49 OSSpinLockLock(&mtx->lock); in mtx_lock()
51 pthread_mutex_lock(&mtx->lock); in mtx_lock()
56 mtx_unlock(mtx_t *mtx) in mtx_unlock() argument
60 LeaveCriticalSection(&mtx->lock); in mtx_unlock()
62 OSSpinLockUnlock(&mtx->lock); in mtx_unlock()
64 pthread_mutex_unlock(&mtx->lock); in mtx_unlock()