Lines Matching refs:mutex
65 static void threading_mutex_init_pthread(mbedtls_threading_mutex_t *mutex) in threading_mutex_init_pthread() argument
67 if (mutex == NULL) { in threading_mutex_init_pthread()
77 mutex->is_valid = pthread_mutex_init(&mutex->mutex, NULL) == 0; in threading_mutex_init_pthread()
80 static void threading_mutex_free_pthread(mbedtls_threading_mutex_t *mutex) in threading_mutex_free_pthread() argument
82 if (mutex == NULL || !mutex->is_valid) { in threading_mutex_free_pthread()
86 (void) pthread_mutex_destroy(&mutex->mutex); in threading_mutex_free_pthread()
87 mutex->is_valid = 0; in threading_mutex_free_pthread()
90 static int threading_mutex_lock_pthread(mbedtls_threading_mutex_t *mutex) in threading_mutex_lock_pthread() argument
92 if (mutex == NULL || !mutex->is_valid) { in threading_mutex_lock_pthread()
96 if (pthread_mutex_lock(&mutex->mutex) != 0) { in threading_mutex_lock_pthread()
103 static int threading_mutex_unlock_pthread(mbedtls_threading_mutex_t *mutex) in threading_mutex_unlock_pthread() argument
105 if (mutex == NULL || !mutex->is_valid) { in threading_mutex_unlock_pthread()
109 if (pthread_mutex_unlock(&mutex->mutex) != 0) { in threading_mutex_unlock_pthread()
129 static int threading_mutex_fail(mbedtls_threading_mutex_t *mutex) in threading_mutex_fail() argument
131 ((void) mutex); in threading_mutex_fail()
134 static void threading_mutex_dummy(mbedtls_threading_mutex_t *mutex) in threading_mutex_dummy() argument
136 ((void) mutex); in threading_mutex_dummy()