Lines Matching refs:mutexp

609 	MUTEX_T mutexp;  in tsrm_mutex_alloc()  local
611 mutexp = malloc(sizeof(CRITICAL_SECTION)); in tsrm_mutex_alloc()
612 InitializeCriticalSection(mutexp); in tsrm_mutex_alloc()
614 mutexp = (MUTEX_T) malloc(sizeof(*mutexp)); in tsrm_mutex_alloc()
615 pth_mutex_init(mutexp); in tsrm_mutex_alloc()
617 mutexp = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)); in tsrm_mutex_alloc()
618 pthread_mutex_init(mutexp,NULL); in tsrm_mutex_alloc()
620 mutexp = crit_init(); in tsrm_mutex_alloc()
622 mutexp = PIPlatform_allocLocalMutex(); in tsrm_mutex_alloc()
624 mutexp = st_mutex_new(); in tsrm_mutex_alloc()
626 mutexp = (beos_ben*)malloc(sizeof(beos_ben)); in tsrm_mutex_alloc()
627 mutexp->ben = 0; in tsrm_mutex_alloc()
628 mutexp->sem = create_sem(1, "PHP sempahore"); in tsrm_mutex_alloc()
633 return( mutexp ); in tsrm_mutex_alloc()
638 TSRM_API void tsrm_mutex_free(MUTEX_T mutexp) in tsrm_mutex_free() argument
640 if (mutexp) { in tsrm_mutex_free()
642 DeleteCriticalSection(mutexp); in tsrm_mutex_free()
643 free(mutexp); in tsrm_mutex_free()
645 free(mutexp); in tsrm_mutex_free()
647 pthread_mutex_destroy(mutexp); in tsrm_mutex_free()
648 free(mutexp); in tsrm_mutex_free()
650 crit_terminate(mutexp); in tsrm_mutex_free()
652 PISync_delete(mutexp); in tsrm_mutex_free()
654 st_mutex_destroy(mutexp); in tsrm_mutex_free()
656 delete_sem(mutexp->sem); in tsrm_mutex_free()
657 free(mutexp); in tsrm_mutex_free()
670 TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp) in tsrm_mutex_lock() argument
674 EnterCriticalSection(mutexp); in tsrm_mutex_lock()
677 if (pth_mutex_acquire(mutexp, 0, NULL)) { in tsrm_mutex_lock()
682 return pthread_mutex_lock(mutexp); in tsrm_mutex_lock()
684 crit_enter(mutexp); in tsrm_mutex_lock()
687 return PISync_lock(mutexp); in tsrm_mutex_lock()
689 return st_mutex_lock(mutexp); in tsrm_mutex_lock()
691 if (atomic_add(&mutexp->ben, 1) != 0) in tsrm_mutex_lock()
692 return acquire_sem(mutexp->sem); in tsrm_mutex_lock()
702 TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp) in tsrm_mutex_unlock() argument
706 LeaveCriticalSection(mutexp); in tsrm_mutex_unlock()
709 if (pth_mutex_release(mutexp)) { in tsrm_mutex_unlock()
714 return pthread_mutex_unlock(mutexp); in tsrm_mutex_unlock()
716 crit_exit(mutexp); in tsrm_mutex_unlock()
719 return PISync_unlock(mutexp); in tsrm_mutex_unlock()
721 return st_mutex_unlock(mutexp); in tsrm_mutex_unlock()
723 if (atomic_add(&mutexp->ben, -1) != 1) in tsrm_mutex_unlock()
724 return release_sem(mutexp->sem); in tsrm_mutex_unlock()