BUG/MINOR: threads: Don't forget to init each thread toremove_lock.
authorOlivier Houchard <cognet@ci0.org>
Mon, 29 Jun 2020 15:48:27 +0000 (17:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 21 Jul 2020 13:02:57 +0000 (15:02 +0200)
Don't forget to use HA_SPIN_INIT() on each toremove_lock, or DEBUG_THREAD may
not work reliably with it.

This should be backported to 2.1 and 2.0.

(cherry picked from commit f21695bd8b59d582efc99c85f9a1afac200eda81)
[wt: the lock is called toremove_lock[i] in 2.1]
Signed-off-by: Willy Tarreau <w@1wt.eu>

src/cfgparse.c

index 1fe0781..30df16b 100644 (file)
@@ -3661,6 +3661,7 @@ out_uri_auth_compat:
                                                        goto err;
                                                idle_conn_cleanup[i]->process = srv_cleanup_toremove_connections;
                                                idle_conn_cleanup[i]->context = NULL;
+                                               HA_SPIN_INIT(&toremove_lock[i]);
                                                MT_LIST_INIT(&toremove_connections[i]);
                                        }
                                }