MINOR: freq_ctr: provide non-blocking read functions
authorWilly Tarreau <w@1wt.eu>
Fri, 21 Feb 2025 17:21:56 +0000 (18:21 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 28 Feb 2025 15:26:27 +0000 (16:26 +0100)
commitdce43434eaf7a402148209c2f0d4371ae063c1fa
tree6a8968164a7aeeaaacfb0ff9269ec7f25ab5aa74
parent5f22fca932a1c3d5c92f30add31ffce81abdf758
MINOR: freq_ctr: provide non-blocking read functions

Some code called by the debug handlers in the context of a signal handler
accesses to some freq_ctr and occasionally ends up on a locked one from
the same thread that is dumping it. Let's introduce a non-blocking version
that at least allows to return even if the value is in the process of being
updated, it's less problematic than hanging.

(cherry picked from commit 29e246a84ce27af63779d98b305ad53877ae9acc)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/freq_ctr.h
src/freq_ctr.c