]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: threads: Fix build when we're not compiling with threads.
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 24 Jan 2018 14:41:04 +0000 (15:41 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Jan 2018 20:41:29 +0000 (21:41 +0100)
Only declare the start_lock if threads are compiled in, otherwise
HA_SPINLOCK_T won't be defined.
This should be backported to 1.8 when/if
1605c7ae6154d8c2cfcf3b325872b1a7266c5bc2 is backported.

src/haproxy.c

index 8e0e30d8a4088459a96aecfb7baa650bd55d8572..8a4e8a56377e7389540598fe876af54fe0300add 100644 (file)
@@ -2422,7 +2422,9 @@ static void *run_thread_poll_loop(void *data)
 {
        struct per_thread_init_fct   *ptif;
        struct per_thread_deinit_fct *ptdf;
-       static __maybe_unused HA_SPINLOCK_T start_lock;
+#ifdef USE_THREAD
+       static HA_SPINLOCK_T start_lock;
+#endif
 
        tid     = *((unsigned int *)data);
        tid_bit = (1UL << tid);