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()
76 mutex->is_valid = pthread_mutex_init( &mutex->mutex, NULL ) == 0; in threading_mutex_init_pthread()
79 static void threading_mutex_free_pthread( mbedtls_threading_mutex_t *mutex ) in threading_mutex_free_pthread() argument
81 if( mutex == NULL || !mutex->is_valid ) in threading_mutex_free_pthread()
84 (void) pthread_mutex_destroy( &mutex->mutex ); in threading_mutex_free_pthread()
85 mutex->is_valid = 0; in threading_mutex_free_pthread()
88 static int threading_mutex_lock_pthread( mbedtls_threading_mutex_t *mutex ) in threading_mutex_lock_pthread() argument
90 if( mutex == NULL || ! mutex->is_valid ) in threading_mutex_lock_pthread()
93 if( pthread_mutex_lock( &mutex->mutex ) != 0 ) in threading_mutex_lock_pthread()
99 static int threading_mutex_unlock_pthread( mbedtls_threading_mutex_t *mutex ) in threading_mutex_unlock_pthread() argument
101 if( mutex == NULL || ! mutex->is_valid ) in threading_mutex_unlock_pthread()
104 if( pthread_mutex_unlock( &mutex->mutex ) != 0 ) in threading_mutex_unlock_pthread()
123 static int threading_mutex_fail( mbedtls_threading_mutex_t *mutex ) in threading_mutex_fail() argument
125 ((void) mutex ); in threading_mutex_fail()
128 static void threading_mutex_dummy( mbedtls_threading_mutex_t *mutex ) in threading_mutex_dummy() argument
130 ((void) mutex ); in threading_mutex_dummy()