REORG: include: split hathreads into haproxy/thread.h and haproxy/thread-t.h

This splits the hathreads.h file into types+macros and functions. Given
that most users of this file used to include it only to get the definition
of THREAD_LOCAL and MAXTHREADS, the bare minimum was placed into thread-t.h
(i.e. types and macros).

All the thread management was left to haproxy/thread.h. It's worth noting
the drop of the trailing "s" in the name, to remove the permanent confusion
that arises between this one and the system implementation (no "s") and the
makefile's option (no "s").

For consistency, src/hathreads.c was also renamed thread.c.

A number of files were updated to only include thread-t which is the one
they really needed.

Some future improvements are possible like replacing empty inlined
functions with macros for the thread-less case, as building at -O0 disables
inlining and causes these ones to be emitted. But this really is cosmetic.
diff --git a/include/types/backend.h b/include/types/backend.h
index 3150ecf..6798058 100644
--- a/include/types/backend.h
+++ b/include/types/backend.h
@@ -23,7 +23,7 @@
 #define _TYPES_BACKEND_H
 
 #include <haproxy/api-t.h>
-#include <common/hathreads.h>
+#include <haproxy/thread.h>
 
 #include <types/lb_chash.h>
 #include <types/lb_fas.h>
diff --git a/include/types/dict.h b/include/types/dict.h
index 30953f6..9807816 100644
--- a/include/types/dict.h
+++ b/include/types/dict.h
@@ -1,7 +1,7 @@
 #ifndef _TYPES_DICT_H
 #define _TYPES_DICT_H
 
-#include <common/hathreads.h>
+#include <haproxy/thread.h>
 #include <import/ebpttree.h>
 
 struct dict_entry {
diff --git a/include/types/dns.h b/include/types/dns.h
index 84a8219..0a8bf72 100644
--- a/include/types/dns.h
+++ b/include/types/dns.h
@@ -25,7 +25,7 @@
 #include <import/eb32tree.h>
 
 #include <haproxy/list-t.h>
-#include <common/hathreads.h>
+#include <haproxy/thread.h>
 
 #include <types/connection.h>
 #include <types/obj_type.h>
diff --git a/include/types/global.h b/include/types/global.h
index cb9ff4b..b0beeb1 100644
--- a/include/types/global.h
+++ b/include/types/global.h
@@ -25,7 +25,7 @@
 #include <netinet/in.h>
 
 #include <haproxy/api-t.h>
-#include <common/hathreads.h>
+#include <haproxy/thread.h>
 
 #include <types/freq_ctr.h>
 #include <types/listener.h>
diff --git a/include/types/listener.h b/include/types/listener.h
index 4314209..50e208e 100644
--- a/include/types/listener.h
+++ b/include/types/listener.h
@@ -31,7 +31,7 @@
 #endif
 
 #include <haproxy/list-t.h>
-#include <common/hathreads.h>
+#include <haproxy/thread.h>
 
 #include <types/obj_type.h>
 #include <import/eb32tree.h>
diff --git a/include/types/log.h b/include/types/log.h
index 301c2bf..ae7ce0b 100644
--- a/include/types/log.h
+++ b/include/types/log.h
@@ -26,7 +26,7 @@
 #include <sys/un.h>
 #include <netinet/in.h>
 #include <haproxy/api-t.h>
-#include <common/hathreads.h>
+#include <haproxy/thread.h>
 #include <haproxy/list-t.h>
 #include <types/ring.h>
 
diff --git a/include/types/proxy.h b/include/types/proxy.h
index f7bdd30..aa1ad35 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -32,7 +32,7 @@
 #include <common/http.h>
 #include <haproxy/list-t.h>
 #include <common/regex.h>
-#include <common/hathreads.h>
+#include <haproxy/thread.h>
 
 #include <import/eb32tree.h>
 #include <import/ebistree.h>
diff --git a/include/types/server.h b/include/types/server.h
index 1737f80..0bc5319 100644
--- a/include/types/server.h
+++ b/include/types/server.h
@@ -26,8 +26,8 @@
 #include <arpa/inet.h>
 
 #include <haproxy/api-t.h>
-#include <haproxy/api.h>
-#include <common/hathreads.h>
+#include <haproxy/list-t.h>
+#include <haproxy/thread.h>
 #include <haproxy/openssl-compat.h>
 
 #include <import/eb32tree.h>
diff --git a/include/types/spoe.h b/include/types/spoe.h
index 85f8b43..562e9f2 100644
--- a/include/types/spoe.h
+++ b/include/types/spoe.h
@@ -26,7 +26,7 @@
 
 #include <common/buffer.h>
 #include <haproxy/list-t.h>
-#include <common/hathreads.h>
+#include <haproxy/thread.h>
 
 #include <types/filters.h>
 #include <types/freq_ctr.h>
diff --git a/include/types/ssl_sock.h b/include/types/ssl_sock.h
index d62e4dd..c8a0681 100644
--- a/include/types/ssl_sock.h
+++ b/include/types/ssl_sock.h
@@ -32,7 +32,7 @@
 #include <types/ssl_crtlist.h>
 
 #include <common/buffer.h>
-#include <common/hathreads.h>
+#include <haproxy/thread.h>
 #include <haproxy/list-t.h>
 #include <haproxy/openssl-compat.h>
 
diff --git a/include/types/vars.h b/include/types/vars.h
index 91fcf07..e7d71d3 100644
--- a/include/types/vars.h
+++ b/include/types/vars.h
@@ -2,7 +2,7 @@
 #define _TYPES_VARS_H
 
 #include <haproxy/list-t.h>
-#include <common/hathreads.h>
+#include <haproxy/thread.h>
 
 #include <types/sample.h>