Merge pull request #3257 from kojo1/user-mutex

fix guard, user define mutex
This commit is contained in:
toddouska
2020-09-03 15:21:53 -07:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -28691,7 +28691,7 @@ int mutex_test(void)
#ifdef WOLFSSL_PTHREADS #ifdef WOLFSSL_PTHREADS
wolfSSL_Mutex m; wolfSSL_Mutex m;
#endif #endif
#ifndef WOLFSSL_NO_MALLOC #if !defined(WOLFSSL_NO_MALLOC) && !defined(WOLFSSL_USER_MUTEX)
wolfSSL_Mutex *mm = wc_InitAndAllocMutex(); wolfSSL_Mutex *mm = wc_InitAndAllocMutex();
if (mm == NULL) if (mm == NULL)
return -12700; return -12700;

View File

@@ -186,8 +186,10 @@
/* do nothing */ /* do nothing */
#else #else
#ifndef SINGLE_THREADED #ifndef SINGLE_THREADED
#define WOLFSSL_PTHREADS #ifndef WOLFSSL_USER_MUTEX
#include <pthread.h> #define WOLFSSL_PTHREADS
#include <pthread.h>
#endif
#endif #endif
#if defined(OPENSSL_EXTRA) && !defined(NO_FILESYSTEM) #if defined(OPENSSL_EXTRA) && !defined(NO_FILESYSTEM)
#include <unistd.h> /* for close of BIO */ #include <unistd.h> /* for close of BIO */