MINOR: threads: Use __decl_hathreads to declare locks
This macro should be used to declare variables or struct members depending on
the USE_THREAD compile option. It avoids the encapsulation of such declarations
between #ifdef/#endif. It is used to declare all lock variables.
diff --git a/include/common/hathreads.h b/include/common/hathreads.h
index 3b8fb0b..31d0f53 100644
--- a/include/common/hathreads.h
+++ b/include/common/hathreads.h
@@ -30,6 +30,8 @@
#ifndef USE_THREAD
+#define __decl_hathreads(decl)
+
#define HA_ATOMIC_CAS(val, old, new) ({((*val) == (*old)) ? (*(val) = (new) , 1) : (*(old) = *(val), 0);})
#define HA_ATOMIC_ADD(val, i) ({*(val) += (i);})
#define HA_ATOMIC_SUB(val, i) ({*(val) -= (i);})
@@ -93,6 +95,8 @@
#include <pthread.h>
#include <import/plock.h>
+#define __decl_hathreads(decl) decl
+
/* TODO: thread: For now, we rely on GCC builtins but it could be a good idea to
* have a header file regrouping all functions dealing with threads. */
#define HA_ATOMIC_CAS(val, old, new) __atomic_compare_exchange_n(val, old, new, 0, 0, 0)