mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 05:04:05 -08:00
resolve race condition in maxGauge (#5647)
* resolve race condition in maxGauge Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@sysdig.com>
This commit is contained in:
parent
61f1723c4a
commit
0c0638b080
|
@ -35,5 +35,7 @@ func (m *maxGauge) Set(value float64) {
|
|||
}
|
||||
|
||||
func (m *maxGauge) Get() float64 {
|
||||
m.mtx.Lock()
|
||||
defer m.mtx.Unlock()
|
||||
return m.value
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue