From afd6f33dcde4a0e1c31ee3a781bab93df997c9c5 Mon Sep 17 00:00:00 2001 From: Not Rob Pike Date: Mon, 11 Mar 2024 16:31:49 -0700 Subject: [PATCH] remove incorrect comment about atomic safety indeed the ival and fval can get updated separately, but such update is always one or the other, not both. --- prometheus/counter.go | 1 - 1 file changed, 1 deletion(-) diff --git a/prometheus/counter.go b/prometheus/counter.go index c1bed45..6e3f1a8 100644 --- a/prometheus/counter.go +++ b/prometheus/counter.go @@ -209,7 +209,6 @@ func (c *counter) get() float64 { if c.integerExposition { return float64(ival % float64Mantissa) } - // XXX atomics here are not strictly safe. ival and fval can be incremented elsewhere separately. fval := math.Float64frombits(atomic.LoadUint64(&c.valBits)) return fval + float64(ival) }