]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Allow to disable pthread mutexes on broken platforms
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Apr 2016 17:12:50 +0000 (18:12 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Apr 2016 17:12:50 +0000 (18:12 +0100)
config.h.in
src/libutil/mem_pool.c
src/libutil/mem_pool.h

index d06c133f9de0ebabdec0f69ebfd636cd173ab427..9cc046c956c69c0322d9ccf8a97eef18e69880a7 100644 (file)
 #cmakedefine WITH_SQLITE         1
 #cmakedefine WITH_SYSTEM_HIREDIS 1
 
+#cmakedefine DISABLE_PTHREAD_MUTEX 1
+
 /* Detect endiannes */
 
 #ifdef HAVE_ENDIAN_H
index 0d1a737fb7767c53f30efc708443620c4a6a2c1a..2b6b4ec9607b6ce5d2538027ed9c83f5d0fe5868 100644 (file)
@@ -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
  */
index 6f631e35d8fc39425900d37ee1d29c04050fe2f1..d9ca55c5a11aa5faff5102c34721131f407d2418 100644 (file)
@@ -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;