From 1229ef312d2155adcb359931b5fa6ca565033701 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 1 Jul 2022 17:26:15 +0200 Subject: [PATCH] MINOR: wdt: do not rely on threads_to_dump anymore This flag is not needed anymore as we're already marking the waiting threads as harmless, thus the thread's bit is already covered by this information. The variable was unexported. --- include/haproxy/debug.h | 1 - src/debug.c | 2 +- src/wdt.c | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/haproxy/debug.h b/include/haproxy/debug.h index 7bfd12ed61..226108acca 100644 --- a/include/haproxy/debug.h +++ b/include/haproxy/debug.h @@ -24,7 +24,6 @@ struct task; struct buffer; -extern volatile unsigned long threads_to_dump; extern unsigned int debug_commands_issued; void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx); void ha_thread_dump(struct buffer *buf, int thr, int calling_tid); diff --git a/src/debug.c b/src/debug.c index 39a6e02313..3fa2845ce2 100644 --- a/src/debug.c +++ b/src/debug.c @@ -50,7 +50,7 @@ /* mask of threads still having to dump, used to respect ordering. Only used * when USE_THREAD_DUMP is set. */ -volatile unsigned long threads_to_dump = 0; +static volatile unsigned long threads_to_dump = 0; unsigned int debug_commands_issued = 0; /* dumps a backtrace of the current thread that is appended to buffer . diff --git a/src/wdt.c b/src/wdt.c index 4e9b7c3adf..9f5b817297 100644 --- a/src/wdt.c +++ b/src/wdt.c @@ -84,7 +84,7 @@ void wdt_handler(int sig, siginfo_t *si, void *arg) goto update_and_leave; if ((_HA_ATOMIC_LOAD(&th_ctx->flags) & TH_FL_SLEEPING) && - ((_HA_ATOMIC_LOAD(&ha_tgroup_ctx[tgrp-1].threads_harmless) | threads_to_dump) & thr_bit)) { + (_HA_ATOMIC_LOAD(&ha_tgroup_ctx[tgrp-1].threads_harmless) & thr_bit)) { /* This thread is currently doing exactly nothing * waiting in the poll loop (unlikely but possible), * waiting for all other threads to join the rendez-vous -- 2.39.5