From: Miod Vallat Date: Fri, 13 Jun 2025 06:37:56 +0000 (+0200) Subject: Use atomic types for "time for next cache cleanup" variable. X-Git-Tag: dnsdist-2.0.0-beta1~31^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a666c75b6058b966632c43dcfc0fef4f4d99b56f;p=thirdparty%2Fpdns.git Use atomic types for "time for next cache cleanup" variable. Fixes: #11816 --- diff --git a/pdns/auth-packetcache.hh b/pdns/auth-packetcache.hh index 8157ae26d9..2f6d27972d 100644 --- a/pdns/auth-packetcache.hh +++ b/pdns/auth-packetcache.hh @@ -148,7 +148,7 @@ private: uint64_t d_maxEntries{0}; size_t d_mapscount; time_t d_lastclean; // doesn't need to be atomic - unsigned long d_nextclean{4096}; + AtomicCounter d_nextclean{4096}; unsigned int d_cleaninterval{4096}; uint32_t d_ttl{0}; bool d_cleanskipped{false}; diff --git a/pdns/auth-querycache.hh b/pdns/auth-querycache.hh index 712cde113d..c4bf8d8385 100644 --- a/pdns/auth-querycache.hh +++ b/pdns/auth-querycache.hh @@ -118,7 +118,7 @@ private: uint64_t d_maxEntries{0}; time_t d_lastclean; // doesn't need to be atomic - unsigned long d_nextclean{4096}; + AtomicCounter d_nextclean{4096}; unsigned int d_cleaninterval{4096}; bool d_cleanskipped{false};