BUG/MINOR: checks/threads: use ha_random() and not rand()
authorWilly Tarreau <w@1wt.eu>
Sun, 8 Mar 2020 16:53:53 +0000 (17:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 11 Mar 2020 06:35:16 +0000 (07:35 +0100)
commit392b146860afc24bb7d13654c76eb14b3f2a2b8f
tree82b585cff9a8b39e9d7af2848a6135d5862a98e8
parentec40e1cb47b35763f4323153ac96009d5fd8535b
BUG/MINOR: checks/threads: use ha_random() and not rand()

In order to honor spread_checks we currently call rand() which is not
thread safe and which must never turn its internal state to zero. This
is not thread safe, let's use ha_random() instead. This is a complement
to commimt 52bf839394 ("BUG/MEDIUM: random: implement a thread-safe and
process-safe PRNG") and may be backported with it.

(cherry picked from commit 5a6d3e797edc7ac52560cc1a5bd90a984b6b350b)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/checks.c