]> git.ipfire.org Git - thirdparty/haproxy.git/commit
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)
committerAurelien DARRAGON <adarragon@haproxy.com>
Fri, 21 Feb 2025 10:22:35 +0000 (11:22 +0100)
commit97a19517ffe3438562f80c314f5b6f3f27df7668
treeb2c09cff2d434bd628fa5dac550e03f43434df11
parent9561b9fb6964af325a10e7128b563114f144a3cb
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
src/clock.c