mirror of
https://github.com/cuberite/polarssl.git
synced 2025-09-13 09:05:08 -04:00
Uniformly use MBEDTLS_THREADING_C guards
Since the code compiles with MBEDTLS_THREADING_C, not just with MBEDTLS_THREADING_PTHREAD, use MBEDTLS_THREADING_C as the guard. The runtime behavior is only as desired under certain conditions that imply MBEDTLS_THREADING_PTHREAD, but that's fine: no metatest is expected to pass in all scenarios, only under specific build- and run-time conditions. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
d4084fd899
commit
96c87c4e7b
@ -141,7 +141,7 @@ void mutex_lock_not_initialized(const char *name)
|
|||||||
(void) name;
|
(void) name;
|
||||||
/* Mutex usage verification is only done with pthread, not with other
|
/* Mutex usage verification is only done with pthread, not with other
|
||||||
* threading implementations. See tests/src/threading_helpers.c. */
|
* threading implementations. See tests/src/threading_helpers.c. */
|
||||||
#if defined(MBEDTLS_THREADING_PTHREAD)
|
#if defined(MBEDTLS_THREADING_C)
|
||||||
mbedtls_threading_mutex_t mutex;
|
mbedtls_threading_mutex_t mutex;
|
||||||
memset(&mutex, 0, sizeof(mutex));
|
memset(&mutex, 0, sizeof(mutex));
|
||||||
TEST_ASSERT(mbedtls_mutex_lock(&mutex) == 0);
|
TEST_ASSERT(mbedtls_mutex_lock(&mutex) == 0);
|
||||||
@ -203,7 +203,7 @@ void mutex_leak(const char *name)
|
|||||||
(void) name;
|
(void) name;
|
||||||
/* Mutex usage verification is only done with pthread, not with other
|
/* Mutex usage verification is only done with pthread, not with other
|
||||||
* threading implementations. See tests/src/threading_helpers.c. */
|
* threading implementations. See tests/src/threading_helpers.c. */
|
||||||
#if defined(MBEDTLS_THREADING_PTHREAD)
|
#if defined(MBEDTLS_THREADING_C)
|
||||||
mbedtls_threading_mutex_t mutex;
|
mbedtls_threading_mutex_t mutex;
|
||||||
mbedtls_mutex_init(&mutex);
|
mbedtls_mutex_init(&mutex);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user