MINOR: clock: always use atomic ops for global_now_ms
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 19 Feb 2025 10:42:04 +0000 (11:42 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 18 Mar 2025 15:12:19 +0000 (16:12 +0100)
commit4c6bd50e1742189e947bad914169a774ffa2d3b9
treed791e7f92f89a05ae885d01d0044b843c8227ab8
parent9e02e4d52087ce2f890223a68dfbca71282dc866
MINOR: clock: always use atomic ops for global_now_ms

global_now_ms is shared between threads so we must give hint to the
compiler that read/writes operations should be performed atomically.

Everywhere global_now_ms was used, atomic ops were used, except in
clock_update_global_date() where a read was performed without using
atomic op. In practise it is not an issue because on most systems
such reads should be atomic already, but to prevent any confusion or
potential bug on exotic systems, let's use an explicit _HA_ATOMIC_LOAD
there.

This may be backported up to 2.8

(cherry picked from commit 97a19517ffe3438562f80c314f5b6f3f27df7668)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit e5057a90eb505d3a8f98d655bf669e6943a62861)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
src/clock.c