mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-07 06:42:56 +03:00
Move key_slot_mutex to threading.h
Make this a global mutex so that we don't have to init and free it. Also rename the mutex to follow the convention Signed-off-by: Ryan Everett <ryan.everett@arm.com>
This commit is contained in:
@@ -148,6 +148,9 @@ void mbedtls_threading_set_alt(void (*mutex_init)(mbedtls_threading_mutex_t *),
|
||||
#if defined(THREADING_USE_GMTIME)
|
||||
mbedtls_mutex_init(&mbedtls_threading_gmtime_mutex);
|
||||
#endif
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
||||
mbedtls_mutext_init(&mbedtls_threading_key_slot_mutex);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -161,6 +164,9 @@ void mbedtls_threading_free_alt(void)
|
||||
#if defined(THREADING_USE_GMTIME)
|
||||
mbedtls_mutex_free(&mbedtls_threading_gmtime_mutex);
|
||||
#endif
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
||||
mbedtls_mutex_free(&mbedtls_threading_key_slot_mutex);
|
||||
#endif
|
||||
}
|
||||
#endif /* MBEDTLS_THREADING_ALT */
|
||||
|
||||
@@ -176,5 +182,8 @@ mbedtls_threading_mutex_t mbedtls_threading_readdir_mutex MUTEX_INIT;
|
||||
#if defined(THREADING_USE_GMTIME)
|
||||
mbedtls_threading_mutex_t mbedtls_threading_gmtime_mutex MUTEX_INIT;
|
||||
#endif
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
||||
mbedtls_threading_mutex_t mbedtls_threading_key_slot_mutex MUTEX_INIT;
|
||||
#endif
|
||||
|
||||
#endif /* MBEDTLS_THREADING_C */
|
||||
|
Reference in New Issue
Block a user