Lines Matching refs:mutexp

598 	MUTEX_T mutexp;  in tsrm_mutex_alloc()  local
600 mutexp = malloc(sizeof(CRITICAL_SECTION)); in tsrm_mutex_alloc()
601 InitializeCriticalSection(mutexp); in tsrm_mutex_alloc()
603 mutexp = (MUTEX_T) malloc(sizeof(*mutexp)); in tsrm_mutex_alloc()
604 pth_mutex_init(mutexp); in tsrm_mutex_alloc()
606 mutexp = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)); in tsrm_mutex_alloc()
607 pthread_mutex_init(mutexp,NULL); in tsrm_mutex_alloc()
609 mutexp = st_mutex_new(); in tsrm_mutex_alloc()
614 return( mutexp ); in tsrm_mutex_alloc()
619 TSRM_API void tsrm_mutex_free(MUTEX_T mutexp) in tsrm_mutex_free() argument
621 if (mutexp) { in tsrm_mutex_free()
623 DeleteCriticalSection(mutexp); in tsrm_mutex_free()
624 free(mutexp); in tsrm_mutex_free()
626 free(mutexp); in tsrm_mutex_free()
628 pthread_mutex_destroy(mutexp); in tsrm_mutex_free()
629 free(mutexp); in tsrm_mutex_free()
631 st_mutex_destroy(mutexp); in tsrm_mutex_free()
644 TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp) in tsrm_mutex_lock() argument
648 EnterCriticalSection(mutexp); in tsrm_mutex_lock()
651 if (pth_mutex_acquire(mutexp, 0, NULL)) { in tsrm_mutex_lock()
656 return pthread_mutex_lock(mutexp); in tsrm_mutex_lock()
658 return st_mutex_lock(mutexp); in tsrm_mutex_lock()
667 TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp) in tsrm_mutex_unlock() argument
671 LeaveCriticalSection(mutexp); in tsrm_mutex_unlock()
674 if (pth_mutex_release(mutexp)) { in tsrm_mutex_unlock()
679 return pthread_mutex_unlock(mutexp); in tsrm_mutex_unlock()
681 return st_mutex_unlock(mutexp); in tsrm_mutex_unlock()