Hi,
getting the value and then exchanging it is not an atomic thread safe operation.
Between the load and the exchange another thread may also change the value.
Correct would be value += current;
void Gauge::Change(const double value) {
auto current = value_.load();
while (!value_.compare_exchange_weak(current, current + value))
;
}
Best regards
Lukas