1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Move handling of mutex->is_valid into threading_helpers.c

This is now a field only used for testing.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
Paul Elliott
2023-11-10 14:05:09 +00:00
parent 9e80a91f27
commit 5fa986c8cb
3 changed files with 29 additions and 19 deletions

View File

@ -28,10 +28,13 @@ extern "C" {
#include <pthread.h>
typedef struct mbedtls_threading_mutex_t {
pthread_mutex_t MBEDTLS_PRIVATE(mutex);
/* is_valid is 0 after a failed init or a free, and nonzero after a
* successful init. This field is not considered part of the public
* API of Mbed TLS and may change without notice. */
/* is_valid is controlled by code in tests/src/threading_helpers - it will
* be 0 after a failed init or a free, and nonzero after a successful init.
* This field is for testing only and thus not considered part of the
* public API of Mbed TLS and may change without notice. */
char MBEDTLS_PRIVATE(is_valid);
} mbedtls_threading_mutex_t;
#endif