MINOR: freq_ctr: provide non-blocking read functions
authorWilly Tarreau <w@1wt.eu>
Fri, 21 Feb 2025 17:21:56 +0000 (18:21 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 18 Mar 2025 15:15:24 +0000 (16:15 +0100)
commitac3df4c2370310d61b98ff6806ed06895131cd2a
tree18eb17f2384bbdcf60441a52af1589de09f9465a
parent57af6578908620d001414a31a9769c3337054c18
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>
(cherry picked from commit dce43434eaf7a402148209c2f0d4371ae063c1fa)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
include/haproxy/freq_ctr.h
src/freq_ctr.c