Home
last modified time | relevance | path

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

/openthread-3.5.0/third_party/mbedtls/repo/tests/src/
Dthreading_helpers.c101 static void mbedtls_test_mutex_usage_error( mbedtls_threading_mutex_t *mutex, in mbedtls_test_mutex_usage_error() argument
104 (void) mutex; in mbedtls_test_mutex_usage_error()
114 static void mbedtls_test_wrap_mutex_init( mbedtls_threading_mutex_t *mutex ) in mbedtls_test_wrap_mutex_init() argument
116 mutex_functions.init( mutex ); in mbedtls_test_wrap_mutex_init()
117 if( mutex->is_valid ) in mbedtls_test_wrap_mutex_init()
121 static void mbedtls_test_wrap_mutex_free( mbedtls_threading_mutex_t *mutex ) in mbedtls_test_wrap_mutex_free() argument
123 switch( mutex->is_valid ) in mbedtls_test_wrap_mutex_free()
126 mbedtls_test_mutex_usage_error( mutex, "free without init or double free" ); in mbedtls_test_wrap_mutex_free()
133 mbedtls_test_mutex_usage_error( mutex, "free without unlock" ); in mbedtls_test_wrap_mutex_free()
136 mbedtls_test_mutex_usage_error( mutex, "corrupted state" ); in mbedtls_test_wrap_mutex_free()
[all …]
/openthread-3.5.0/third_party/mbedtls/repo/library/
Dthreading.c65 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()
[all …]
Dssl_cookie.c79 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_ssl_cookie_init()
93 mbedtls_mutex_free( &ctx->mutex ); in mbedtls_ssl_cookie_free()
174 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_ssl_cookie_write()
182 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_ssl_cookie_write()
210 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_ssl_cookie_check()
220 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_ssl_cookie_check()
Dssl_cache.c49 mbedtls_mutex_init( &cache->mutex ); in mbedtls_ssl_cache_init()
63 if( mbedtls_mutex_lock( &cache->mutex ) != 0 ) in mbedtls_ssl_cache_get()
131 if( mbedtls_mutex_unlock( &cache->mutex ) != 0 ) in mbedtls_ssl_cache_get()
150 if( ( ret = mbedtls_mutex_lock( &cache->mutex ) ) != 0 ) in mbedtls_ssl_cache_set()
295 if( mbedtls_mutex_unlock( &cache->mutex ) != 0 ) in mbedtls_ssl_cache_set()
340 mbedtls_mutex_free( &cache->mutex ); in mbedtls_ssl_cache_free()
Dentropy.c66 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_entropy_init()
128 mbedtls_mutex_free( &ctx->mutex ); in mbedtls_entropy_free()
150 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_entropy_add_source()
170 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_entropy_add_source()
242 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_entropy_update_manual()
249 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_entropy_update_manual()
314 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_entropy_gather()
321 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_entropy_gather()
351 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_entropy_func()
443 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_entropy_func()
Dssl_ticket.c47 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_ssl_ticket_init()
224 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_ssl_ticket_write()
271 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_ssl_ticket_write()
318 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_ssl_ticket_parse()
382 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_ssl_ticket_parse()
398 mbedtls_mutex_free( &ctx->mutex ); in mbedtls_ssl_ticket_free()
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()
Dhmac_drbg.c129 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_hmac_drbg_seed_buf()
259 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_hmac_drbg_seed()
405 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_hmac_drbg_random()
412 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_hmac_drbg_random()
431 mbedtls_mutex_free( &ctx->mutex ); in mbedtls_hmac_drbg_free()
Dctr_drbg.c73 mbedtls_mutex_free( &ctx->mutex ); in mbedtls_ctr_drbg_free()
461 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_ctr_drbg_seed()
598 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_ctr_drbg_random()
605 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_ctr_drbg_random()
Drsa.c482 mbedtls_mutex_init( &ctx->mutex ); in mbedtls_rsa_init()
734 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_rsa_public()
752 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_rsa_public()
905 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_rsa_private()
1047 if( mbedtls_mutex_unlock( &ctx->mutex ) != 0 ) in mbedtls_rsa_private()
2372 mbedtls_mutex_free( &ctx->mutex ); in mbedtls_rsa_free()
/openthread-3.5.0/third_party/mbedtls/repo/include/mbedtls/
Dthreading.h51 pthread_mutex_t mutex; member
98 extern void (*mbedtls_mutex_init)( mbedtls_threading_mutex_t *mutex );
99 extern void (*mbedtls_mutex_free)( mbedtls_threading_mutex_t *mutex );
100 extern int (*mbedtls_mutex_lock)( mbedtls_threading_mutex_t *mutex );
101 extern int (*mbedtls_mutex_unlock)( mbedtls_threading_mutex_t *mutex );
Dssl_cookie.h67 mbedtls_threading_mutex_t mutex; member
Dssl_ticket.h74 mbedtls_threading_mutex_t mutex; member
Dssl_cache.h87 mbedtls_threading_mutex_t mutex; /*!< mutex */ member
Dentropy.h142 mbedtls_threading_mutex_t mutex; /*!< mutex */ member
Dhmac_drbg.h116 mbedtls_threading_mutex_t mutex; member
Dctr_drbg.h214 mbedtls_threading_mutex_t mutex; member
Drsa.h145 mbedtls_threading_mutex_t mutex; /*!< Thread-safety mutex. */ member
/openthread-3.5.0/third_party/mbedtls/repo/tests/suites/
Dtest_suite_psa_crypto_init.function73 mbedtls_mutex_init( &ctx->mutex );
/openthread-3.5.0/third_party/mbedtls/repo/
DChangeLog407 is enabled, on platforms where initializing a mutex allocates resources.
413 enabled on platforms where freeing a mutex twice is not safe.
416 a mutex allocates resources.
2742 result trying to unlock an unlocked mutex on invalid input (found by