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.
This commit is contained in:
parent
f55a4e3265
commit
afd6f33dcd
|
@ -209,7 +209,6 @@ func (c *counter) get() float64 {
|
||||||
if c.integerExposition {
|
if c.integerExposition {
|
||||||
return float64(ival % float64Mantissa)
|
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))
|
fval := math.Float64frombits(atomic.LoadUint64(&c.valBits))
|
||||||
return fval + float64(ival)
|
return fval + float64(ival)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue