diff options
-rw-r--r-- | config.h.in | 2 | ||||
-rw-r--r-- | src/libutil/mem_pool.c | 2 | ||||
-rw-r--r-- | src/libutil/mem_pool.h | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/config.h.in b/config.h.in index d06c133f9..9cc046c95 100644 --- a/config.h.in +++ b/config.h.in @@ -131,6 +131,8 @@ #cmakedefine WITH_SQLITE 1 #cmakedefine WITH_SYSTEM_HIREDIS 1 +#cmakedefine DISABLE_PTHREAD_MUTEX 1 + /* Detect endiannes */ #ifdef HAVE_ENDIAN_H diff --git a/src/libutil/mem_pool.c b/src/libutil/mem_pool.c index 0d1a737fb..2b6b4ec96 100644 --- a/src/libutil/mem_pool.c +++ b/src/libutil/mem_pool.c @@ -625,7 +625,7 @@ rspamd_mempool_suggest_size (void) #endif } -#ifndef HAVE_PTHREAD_PROCESS_SHARED +#if !defined(HAVE_PTHREAD_PROCESS_SHARED) || defined(DISABLE_PTHREAD_MUTEX) /* * Own emulation */ diff --git a/src/libutil/mem_pool.h b/src/libutil/mem_pool.h index 6f631e35d..d9ca55c5a 100644 --- a/src/libutil/mem_pool.h +++ b/src/libutil/mem_pool.h @@ -13,7 +13,7 @@ #define RSPAMD_MEM_POOL_H #include "config.h" -#ifdef HAVE_PTHREAD_PROCESS_SHARED +#if defined(HAVE_PTHREAD_PROCESS_SHARED) && !defined(DISABLE_PTHREAD_MUTEX) #include <pthread.h> #endif @@ -40,7 +40,7 @@ typedef void (*rspamd_mempool_destruct_t)(void *ptr); /** * Pool mutex structure */ -#ifndef HAVE_PTHREAD_PROCESS_SHARED +#if !defined(HAVE_PTHREAD_PROCESS_SHARED) || defined(DISABLE_PTHREAD_MUTEX) typedef struct memory_pool_mutex_s { gint lock; pid_t owner; |