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:
Dmitry Shmulevich 2019-06-13 12:55:08 -07:00 committed by Brian Brazil
parent 61f1723c4a
commit 0c0638b080
1 changed files with 2 additions and 0 deletions

View File

@ -35,5 +35,7 @@ func (m *maxGauge) Set(value float64) {
} }
func (m *maxGauge) Get() float64 { func (m *maxGauge) Get() float64 {
m.mtx.Lock()
defer m.mtx.Unlock()
return m.value return m.value
} }