Lines Matching refs:mutex
295 int uv_mutex_init(uv_mutex_t* mutex) { in uv_mutex_init() argument
297 return UV__ERR(pthread_mutex_init(mutex, NULL)); in uv_mutex_init()
308 err = pthread_mutex_init(mutex, &attr); in uv_mutex_init()
318 int uv_mutex_init_recursive(uv_mutex_t* mutex) { in uv_mutex_init_recursive() argument
328 err = pthread_mutex_init(mutex, &attr); in uv_mutex_init_recursive()
337 void uv_mutex_destroy(uv_mutex_t* mutex) { in uv_mutex_destroy() argument
338 if (pthread_mutex_destroy(mutex)) in uv_mutex_destroy()
343 void uv_mutex_lock(uv_mutex_t* mutex) { in uv_mutex_lock() argument
344 if (pthread_mutex_lock(mutex)) in uv_mutex_lock()
349 int uv_mutex_trylock(uv_mutex_t* mutex) { in uv_mutex_trylock() argument
352 err = pthread_mutex_trylock(mutex); in uv_mutex_trylock()
363 void uv_mutex_unlock(uv_mutex_t* mutex) { in uv_mutex_unlock() argument
364 if (pthread_mutex_unlock(mutex)) in uv_mutex_unlock()
529 uv_mutex_t mutex; member
547 if ((err = uv_mutex_init(&sem->mutex)) != 0) { in uv__custom_sem_init()
553 uv_mutex_destroy(&sem->mutex); in uv__custom_sem_init()
569 uv_mutex_destroy(&sem->mutex); in uv__custom_sem_destroy()
578 uv_mutex_lock(&sem->mutex); in uv__custom_sem_post()
582 uv_mutex_unlock(&sem->mutex); in uv__custom_sem_post()
590 uv_mutex_lock(&sem->mutex); in uv__custom_sem_wait()
592 uv_cond_wait(&sem->cond, &sem->mutex); in uv__custom_sem_wait()
594 uv_mutex_unlock(&sem->mutex); in uv__custom_sem_wait()
602 if (uv_mutex_trylock(&sem->mutex) != 0) in uv__custom_sem_trywait()
606 uv_mutex_unlock(&sem->mutex); in uv__custom_sem_trywait()
611 uv_mutex_unlock(&sem->mutex); in uv__custom_sem_trywait()
754 pthread_mutex_t mutex; in uv_cond_destroy() local
758 if (pthread_mutex_init(&mutex, NULL)) in uv_cond_destroy()
761 if (pthread_mutex_lock(&mutex)) in uv_cond_destroy()
767 err = pthread_cond_timedwait_relative_np(cond, &mutex, &ts); in uv_cond_destroy()
771 if (pthread_mutex_unlock(&mutex)) in uv_cond_destroy()
774 if (pthread_mutex_destroy(&mutex)) in uv_cond_destroy()
794 void uv_cond_wait(uv_cond_t* cond, uv_mutex_t* mutex) { in uv_cond_wait() argument
798 r = pthread_cond_wait(cond, mutex); in uv_cond_wait()
813 void uv_cond_wait(uv_cond_t* cond, uv_mutex_t* mutex) { in uv_cond_wait() argument
814 if (pthread_cond_wait(cond, mutex)) in uv_cond_wait()
820 int uv_cond_timedwait(uv_cond_t* cond, uv_mutex_t* mutex, uint64_t timeout) { in uv_cond_timedwait() argument
830 r = pthread_cond_timedwait_relative_np(cond, mutex, &ts); in uv_cond_timedwait()
841 r = pthread_cond_timedwait(cond, mutex, &ts); in uv_cond_timedwait()