diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index ac4d91d4e..4270793fc 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -27880,7 +27880,7 @@ int mutex_test(void) #ifdef WOLFSSL_PTHREADS wolfSSL_Mutex m; #endif -#ifndef WOLFSSL_NO_MALLOC +#if !defined(WOLFSSL_NO_MALLOC) && !defined(WOLFSSL_USER_MUTEX) wolfSSL_Mutex *mm = wc_InitAndAllocMutex(); if (mm == NULL) return -12700; diff --git a/wolfssl/internal.h b/wolfssl/internal.h index a6dc8695f..c10f9223b 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -183,8 +183,10 @@ /* do nothing */ #else #ifndef SINGLE_THREADED - #define WOLFSSL_PTHREADS - #include + #ifndef WOLFSSL_USER_MUTEX + #define WOLFSSL_PTHREADS + #include + #endif #endif #if defined(OPENSSL_EXTRA) && !defined(NO_FILESYSTEM) #include /* for close of BIO */