]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: remove THREAD_LOCAL from config.h
authorWilly Tarreau <w@1wt.eu>
Sat, 9 May 2020 07:08:09 +0000 (09:08 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 9 May 2020 07:08:09 +0000 (09:08 +0200)
This one really ought to be defined in hathreads.h like all other thread
definitions, which is what this patch does. As expected, all files but
one (regex.h) were already including hathreads.h when using THREAD_LOCAL;
regex.h was fixed for this.

This was the last entry in config.h which is now useless.

include/common/config.h
include/common/hathreads.h
include/common/regex.h

index 365705c4c3d64132618dbc4b87c2f32e97210971..30da555e1bafeb82b5ee281028630f946e2f34c5 100644 (file)
 #include <common/compat.h>
 #include <common/defaults.h>
 
-#ifdef USE_THREAD
-#define THREAD_LOCAL __thread
-#else
-#define THREAD_LOCAL
-#endif
-
 #endif /* _COMMON_CONFIG_H */
index cc54574fad77f9f68619d27787b903af3275fbb6..ae1009a9f9ab84ba360a40795e0cb100a2f8cb87 100644 (file)
@@ -44,6 +44,7 @@
 
 #ifndef USE_THREAD
 
+#define THREAD_LOCAL  /* empty */
 #define MAX_THREADS 1
 #define MAX_THREADS_MASK 1
 
@@ -258,6 +259,8 @@ static inline unsigned long thread_isolated()
 #include <pthread.h>
 #include <import/plock.h>
 
+#define THREAD_LOCAL __thread
+
 #ifndef MAX_THREADS
 #define MAX_THREADS LONGBITS
 #endif
index 0069b2d1e198a52c5d30b967bb7f6a029a172d7d..066f07edda8f82675efd921ef2aae6887fcdd630 100644 (file)
@@ -26,6 +26,7 @@
 #include <string.h>
 
 #include <common/config.h>
+#include <common/hathreads.h>
 
 #ifdef USE_PCRE
 #include <pcre.h>