Lines Matching refs:mutex
70 rc = uv_mutex_init(&b->mutex); in uv_barrier_init()
82 uv_mutex_destroy(&b->mutex); in uv_barrier_init()
97 uv_mutex_lock(&b->mutex); in uv_barrier_wait()
105 uv_cond_wait(&b->cond, &b->mutex); in uv_barrier_wait()
112 uv_mutex_unlock(&b->mutex); in uv_barrier_wait()
121 uv_mutex_lock(&b->mutex); in uv_barrier_destroy()
125 uv_cond_wait(&b->cond, &b->mutex); in uv_barrier_destroy()
130 uv_mutex_unlock(&b->mutex); in uv_barrier_destroy()
131 uv_mutex_destroy(&b->mutex); in uv_barrier_destroy()
302 int uv_mutex_init(uv_mutex_t* mutex) { in uv_mutex_init() argument
304 return UV__ERR(pthread_mutex_init(mutex, NULL)); in uv_mutex_init()
315 err = pthread_mutex_init(mutex, &attr); in uv_mutex_init()
325 int uv_mutex_init_recursive(uv_mutex_t* mutex) { in uv_mutex_init_recursive() argument
335 err = pthread_mutex_init(mutex, &attr); in uv_mutex_init_recursive()
344 void uv_mutex_destroy(uv_mutex_t* mutex) { in uv_mutex_destroy() argument
345 if (pthread_mutex_destroy(mutex)) in uv_mutex_destroy()
350 void uv_mutex_lock(uv_mutex_t* mutex) { in uv_mutex_lock() argument
351 if (pthread_mutex_lock(mutex)) in uv_mutex_lock()
356 int uv_mutex_trylock(uv_mutex_t* mutex) { in uv_mutex_trylock() argument
359 err = pthread_mutex_trylock(mutex); in uv_mutex_trylock()
370 void uv_mutex_unlock(uv_mutex_t* mutex) { in uv_mutex_unlock() argument
371 if (pthread_mutex_unlock(mutex)) in uv_mutex_unlock()
536 uv_mutex_t mutex; member
554 if ((err = uv_mutex_init(&sem->mutex)) != 0) { in uv__custom_sem_init()
560 uv_mutex_destroy(&sem->mutex); in uv__custom_sem_init()
576 uv_mutex_destroy(&sem->mutex); in uv__custom_sem_destroy()
585 uv_mutex_lock(&sem->mutex); in uv__custom_sem_post()
589 uv_mutex_unlock(&sem->mutex); in uv__custom_sem_post()
597 uv_mutex_lock(&sem->mutex); in uv__custom_sem_wait()
599 uv_cond_wait(&sem->cond, &sem->mutex); in uv__custom_sem_wait()
601 uv_mutex_unlock(&sem->mutex); in uv__custom_sem_wait()
609 if (uv_mutex_trylock(&sem->mutex) != 0) in uv__custom_sem_trywait()
613 uv_mutex_unlock(&sem->mutex); in uv__custom_sem_trywait()
618 uv_mutex_unlock(&sem->mutex); in uv__custom_sem_trywait()
761 pthread_mutex_t mutex; in uv_cond_destroy() local
765 if (pthread_mutex_init(&mutex, NULL)) in uv_cond_destroy()
768 if (pthread_mutex_lock(&mutex)) in uv_cond_destroy()
774 err = pthread_cond_timedwait_relative_np(cond, &mutex, &ts); in uv_cond_destroy()
778 if (pthread_mutex_unlock(&mutex)) in uv_cond_destroy()
781 if (pthread_mutex_destroy(&mutex)) in uv_cond_destroy()
799 void uv_cond_wait(uv_cond_t* cond, uv_mutex_t* mutex) { in uv_cond_wait() argument
800 if (pthread_cond_wait(cond, mutex)) in uv_cond_wait()
805 int uv_cond_timedwait(uv_cond_t* cond, uv_mutex_t* mutex, uint64_t timeout) { in uv_cond_timedwait() argument
815 r = pthread_cond_timedwait_relative_np(cond, mutex, &ts); in uv_cond_timedwait()
826 r = pthread_cond_timedwait(cond, mutex, &ts); in uv_cond_timedwait()