diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index b12fb0992..38489a87e 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -28691,7 +28691,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 925720fd2..4e26a16cc 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -186,8 +186,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 */