Forráskód Böngészése

Mariano's right: clear the sample inside the lock.

Richard Crowley 12 éve
szülő
commit
9179d9e3e3
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      histogram.go

+ 1 - 1
histogram.go

@@ -50,12 +50,12 @@ func NewHistogram(s Sample) *StandardHistogram {
 
 // Clear the histogram.
 func (h *StandardHistogram) Clear() {
-	h.s.Clear()
 	h.mutex.Lock()
 	defer h.mutex.Unlock()
 	h.count = 0
 	h.max = math.MinInt64
 	h.min = math.MaxInt64
+	h.s.Clear()
 	h.sum = 0
 	h.variance = [...]float64{-1.0, 0.0}
 }