Home
last modified time | relevance | path

Searched refs:mutex (Results 1 – 20 of 20) sorted by relevance

/mbedtls-development/tests/src/
A Dthreading_helpers.c104 (void) mutex; in mbedtls_test_mutex_usage_error()
116 mutex_functions.init( mutex ); in mbedtls_test_wrap_mutex_init()
117 if( mutex->is_valid ) in mbedtls_test_wrap_mutex_init()
123 switch( mutex->is_valid ) in mbedtls_test_wrap_mutex_free()
139 if( mutex->is_valid ) in mbedtls_test_wrap_mutex_free()
141 mutex_functions.free( mutex ); in mbedtls_test_wrap_mutex_free()
146 int ret = mutex_functions.lock( mutex ); in mbedtls_test_wrap_mutex_lock()
147 switch( mutex->is_valid ) in mbedtls_test_wrap_mutex_lock()
154 mutex->is_valid = 2; in mbedtls_test_wrap_mutex_lock()
169 switch( mutex->is_valid ) in mbedtls_test_wrap_mutex_unlock()
[all …]
/mbedtls-development/library/
A Dthreading.c67 if( mutex == NULL ) in threading_mutex_init_pthread()
76 mutex->is_valid = pthread_mutex_init( &mutex->mutex, NULL ) == 0; in threading_mutex_init_pthread()
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()
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()
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()
125 ((void) mutex ); in threading_mutex_fail()
[all …]
A Dssl_cookie.c77 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_ssl_cookie_init()
91 mbedtls_mutex_free( &ctx->mutex ); in mbedtls_ssl_cookie_free()
172 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_ssl_cookie_write()
180 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_ssl_cookie_write()
208 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_ssl_cookie_check()
218 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_ssl_cookie_check()
A Dssl_cache.c49 mbedtls_mutex_init( &cache->mutex ); in mbedtls_ssl_cache_init()
102 if( mbedtls_mutex_lock( &cache->mutex ) != 0 ) in mbedtls_ssl_cache_get()
120 if( mbedtls_mutex_unlock( &cache->mutex ) != 0 ) in mbedtls_ssl_cache_get()
260 if( ( ret = mbedtls_mutex_lock( &cache->mutex ) ) != 0 ) in mbedtls_ssl_cache_set()
310 if( mbedtls_mutex_unlock( &cache->mutex ) != 0 ) in mbedtls_ssl_cache_set()
352 mbedtls_mutex_free( &cache->mutex ); in mbedtls_ssl_cache_free()
A Dentropy.c57 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_entropy_init()
98 mbedtls_mutex_free( &ctx->mutex ); in mbedtls_entropy_free()
120 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_entropy_add_source()
140 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_entropy_add_source()
212 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_entropy_update_manual()
219 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_entropy_update_manual()
284 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_entropy_gather()
291 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_entropy_gather()
321 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_entropy_func()
413 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_entropy_func()
A Dssl_ticket.c47 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_ssl_ticket_init()
222 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_ssl_ticket_write()
269 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_ssl_ticket_write()
316 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_ssl_ticket_parse()
380 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_ssl_ticket_parse()
396 mbedtls_mutex_free( &ctx->mutex ); in mbedtls_ssl_ticket_free()
A Dmemory_buffer_alloc.c77 mbedtls_threading_mutex_t mutex; member
548 if( mbedtls_mutex_lock( &heap.mutex ) != 0 ) in buffer_alloc_calloc_mutexed()
551 if( mbedtls_mutex_unlock( &heap.mutex ) ) in buffer_alloc_calloc_mutexed()
560 if( mbedtls_mutex_lock( &heap.mutex ) ) in buffer_alloc_free_mutexed()
563 (void) mbedtls_mutex_unlock( &heap.mutex ); in buffer_alloc_free_mutexed()
572 mbedtls_mutex_init( &heap.mutex ); in mbedtls_memory_buffer_alloc_init()
605 mbedtls_mutex_free( &heap.mutex ); in mbedtls_memory_buffer_alloc_free()
A Dhmac_drbg.c120 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_hmac_drbg_seed_buf()
250 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_hmac_drbg_seed()
396 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_hmac_drbg_random()
403 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_hmac_drbg_random()
422 mbedtls_mutex_free( &ctx->mutex ); in mbedtls_hmac_drbg_free()
A Dctr_drbg.c73 mbedtls_mutex_free( &ctx->mutex ); in mbedtls_ctr_drbg_free()
448 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_ctr_drbg_seed()
585 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_ctr_drbg_random()
592 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_ctr_drbg_random()
A Drsa.c493 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_rsa_init()
768 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_rsa_public()
786 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_rsa_public()
942 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_rsa_private()
1075 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_rsa_private()
2504 mbedtls_mutex_free( &ctx->mutex ); in mbedtls_rsa_free()
/mbedtls-development/include/mbedtls/
A Dthreading.h43 pthread_mutex_t MBEDTLS_PRIVATE(mutex);
90 extern void (*mbedtls_mutex_init)( mbedtls_threading_mutex_t *mutex );
91 extern void (*mbedtls_mutex_free)( mbedtls_threading_mutex_t *mutex );
92 extern int (*mbedtls_mutex_lock)( mbedtls_threading_mutex_t *mutex );
93 extern int (*mbedtls_mutex_unlock)( mbedtls_threading_mutex_t *mutex );
A Dssl_cookie.h64 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex);
A Dssl_ticket.h71 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex);
A Dssl_cache.h86 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex); /*!< mutex */
A Dhmac_drbg.h113 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex);
A Dentropy.h133 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex); /*!< mutex */
A Dctr_drbg.h211 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex);
A Drsa.h127 mbedtls_threading_mutex_t MBEDTLS_PRIVATE(mutex); /*!< Thread-safety mutex. */
/mbedtls-development/tests/suites/
A Dtest_suite_psa_crypto_init.function72 mbedtls_mutex_init( &ctx->mutex );
/mbedtls-development/
A DChangeLog551 is enabled, on platforms where initializing a mutex allocates resources.
557 enabled on platforms where freeing a mutex twice is not safe.
560 a mutex allocates resources.
2886 result trying to unlock an unlocked mutex on invalid input (found by

Completed in 36 milliseconds