Lines Matching refs:mutexp

664 	MUTEX_T mutexp;  in tsrm_mutex_alloc()  local
666 mutexp = malloc(sizeof(CRITICAL_SECTION)); in tsrm_mutex_alloc()
667 InitializeCriticalSection(mutexp); in tsrm_mutex_alloc()
669 mutexp = (MUTEX_T) malloc(sizeof(*mutexp)); in tsrm_mutex_alloc()
670 pth_mutex_init(mutexp); in tsrm_mutex_alloc()
672 mutexp = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)); in tsrm_mutex_alloc()
673 pthread_mutex_init(mutexp,NULL); in tsrm_mutex_alloc()
675 mutexp = st_mutex_new(); in tsrm_mutex_alloc()
680 return( mutexp ); in tsrm_mutex_alloc()
685 TSRM_API void tsrm_mutex_free(MUTEX_T mutexp) in tsrm_mutex_free() argument
687 if (mutexp) { in tsrm_mutex_free()
689 DeleteCriticalSection(mutexp); in tsrm_mutex_free()
690 free(mutexp); in tsrm_mutex_free()
692 free(mutexp); in tsrm_mutex_free()
694 pthread_mutex_destroy(mutexp); in tsrm_mutex_free()
695 free(mutexp); in tsrm_mutex_free()
697 st_mutex_destroy(mutexp); in tsrm_mutex_free()
710 TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp) in tsrm_mutex_lock() argument
714 EnterCriticalSection(mutexp); in tsrm_mutex_lock()
717 if (pth_mutex_acquire(mutexp, 0, NULL)) { in tsrm_mutex_lock()
722 return pthread_mutex_lock(mutexp); in tsrm_mutex_lock()
724 return st_mutex_lock(mutexp); in tsrm_mutex_lock()
733 TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp) in tsrm_mutex_unlock() argument
737 LeaveCriticalSection(mutexp); in tsrm_mutex_unlock()
740 if (pth_mutex_release(mutexp)) { in tsrm_mutex_unlock()
745 return pthread_mutex_unlock(mutexp); in tsrm_mutex_unlock()
747 return st_mutex_unlock(mutexp); in tsrm_mutex_unlock()