#endif
#endif
+/* The THREAD_LOCAL type attribute defines thread-local storage and is defined
+ * to __thread when threads are enabled or empty when disabled.
+ */
+#ifdef USE_THREAD
+#define THREAD_LOCAL __thread
+#else
+#define THREAD_LOCAL
+#endif
+
+/* The __decl_thread() statement is shows the argument when threads are enabled
+ * or hides it when disabled. The purpose is to condition the presence of some
+ * variables or struct members to the fact that threads are enabled, without
+ * having to enclose them inside a #ifdef USE_THREAD/#endif clause.
+ */
+#ifdef USE_THREAD
+#define __decl_thread(decl) decl
+#else
+#define __decl_thread(decl)
+#endif
+
#endif /* _HAPROXY_COMPILER_H */
#include <import/ebpttree.h>
#include <haproxy/api-t.h>
-#include <haproxy/thread.h>
+#include <haproxy/thread-t.h>
struct dict_entry {
struct ebpt_node value;
#include <haproxy/global-t.h>
#include <haproxy/api-t.h>
-#include <haproxy/thread.h>
#include <haproxy/vars-t.h>
#include <haproxy/mworker-t.h>
#include <haproxy/pool-t.h>
#include <haproxy/proxy-t.h>
#include <haproxy/stream.h>
-#include <haproxy/thread-t.h>
extern struct pool_head *pool_head_requri;
extern struct pool_head *pool_head_uniqueid;
#include <string.h>
#include <haproxy/api.h>
-#include <haproxy/thread-t.h>
#ifdef USE_PCRE
#include <pcre.h>
#include <haproxy/api.h>
#include <haproxy/regex-t.h>
-#include <haproxy/thread-t.h>
extern THREAD_LOCAL regmatch_t pmatch[MAX_MATCH];
/********************** THREADS DISABLED ************************/
-#define THREAD_LOCAL /* empty */
-
/* These macros allow to make some struct fields or local variables optional */
-#define __decl_thread(decl)
#define __decl_spinlock(lock)
#define __decl_aligned_spinlock(lock)
#define __decl_rwlock(lock)
/********************** THREADS ENABLED ************************/
-#define THREAD_LOCAL __thread
-
-#define __decl_thread(decl) decl
-
/* declare a self-initializing spinlock */
#define __decl_spinlock(lock) \
HA_SPINLOCK_T (lock); \
#include <haproxy/api.h>
#include <haproxy/list.h>
#include <haproxy/sink-t.h>
-#include <haproxy/thread-t.h>
#include <haproxy/tools.h>
#include <haproxy/trace-t.h>
#include <import/eb32tree.h>
#include <import/ebistree.h>
#include <haproxy/dict.h>
+#include <haproxy/thread.h>
struct dict *new_dict(const char *name)
{
#include <haproxy/api.h>
#include <haproxy/global.h>
#include <haproxy/signal.h>
-#include <haproxy/thread-t.h>
#include <haproxy/tools.h>
#include <haproxy/ticks.h>
#include <haproxy/time.h>
#include <haproxy/api.h>
#include <haproxy/signal.h>
-#include <haproxy/thread-t.h>
#include <haproxy/ticks.h>
#include <haproxy/time.h>
#include <haproxy/api.h>
#include <haproxy/signal.h>
-#include <haproxy/thread-t.h>
#include <haproxy/ticks.h>
#include <haproxy/time.h>
#include <sys/types.h>
#include <haproxy/api.h>
-#include <haproxy/thread-t.h>
#include <haproxy/ticks.h>
#include <haproxy/time.h>
#include <sys/types.h>
#include <haproxy/api.h>
-#include <haproxy/thread-t.h>
#include <haproxy/ticks.h>
#include <haproxy/time.h>
#include <haproxy/api.h>
#include <haproxy/tools.h>
#include <haproxy/time.h>
-#include <haproxy/thread-t.h>
THREAD_LOCAL unsigned int ms_left_scaled; /* milliseconds left for current second (0..2^32-1) */
THREAD_LOCAL unsigned int now_ms; /* internal date in milliseconds (may wrap) */