]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: wdt: do not rely on threads_to_dump anymore
authorWilly Tarreau <w@1wt.eu>
Fri, 1 Jul 2022 15:26:15 +0000 (17:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 Jul 2022 17:26:35 +0000 (19:26 +0200)
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
src/debug.c
src/wdt.c

index 7bfd12ed61e122cd7d5e0550d0fd7e3a868a9391..226108acca26d98896e489d1d436e29517df23fa 100644 (file)
@@ -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);
index 39a6e02313a37261ba8f5b485e90d3d9425d10fa..3fa2845ce294ffaeb19267ba8269be86b47a0af1 100644 (file)
@@ -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 <buf>.
index 4e9b7c3adf9d323c72d99a6fce9cf015f632bfd3..9f5b8172976b40b0f1e040d26ca69814be9104ed 100644 (file)
--- 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