]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: use tg->threads_enabled in hard_stop() to detect stopped threads
authorWilly Tarreau <w@1wt.eu>
Mon, 4 Jul 2022 11:33:13 +0000 (13:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 4 Jul 2022 12:09:39 +0000 (14:09 +0200)
Let's rely on tg->threads_enabled there to detect running threads. We
should probably have a dedicated function for this in order to simplify
the code and avoid the risk of using the wrong group ID.

src/proxy.c

index c10a8cf838c9eaef2ebba43fa79342e08686187b..7c0732127677d8c262129506bb2747f00ec3fbc8 100644 (file)
@@ -2140,7 +2140,7 @@ struct task *hard_stop(struct task *t, void *context, unsigned int state)
                send_log(NULL, LOG_WARNING, "Some tasks resisted to hard-stop, exiting now.\n");
                killed = 2;
                for (thr = 0; thr < global.nbthread; thr++)
-                       if (((all_threads_mask & ~tid_bit) >> thr) & 1)
+                       if (ha_thread_info[thr].tg->threads_enabled & ha_thread_info[thr].ltid_bit)
                                wake_thread(thr);
                t->expire = TICK_ETERNITY;
                return t;