]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: threads: Add THREAD_LOCAL macro
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 29 Aug 2017 07:51:52 +0000 (09:51 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 10:36:13 +0000 (11:36 +0100)
When compiled with threads support, this marco is set to __thread. Else it is
empty.

include/common/config.h

index f5d290f603aed14625718d541e4ba70700754888..f06ba3b87d96b624746392d5206805c86661ef00 100644 (file)
 #  define CONFIG_HAP_MEM_OPTIM
 #endif /* CONFIG_HAP_NO_MEM_OPTIM */
 
+#ifdef USE_THREAD
+#define THREAD_LOCAL __thread
+#else
+#define THREAD_LOCAL
+#endif
+
 /* CONFIG_HAP_INLINE_FD_SET
  * This makes use of inline FD_* macros instead of calling equivalent
  * functions. Benchmarks on a Pentium-M show that using functions is