fix off-by-one error in the threshold
@@ -43,7 +43,7 @@ func (t *threshold) Release() {
// Wait waits for the counter to drop below the threshold
func (t *threshold) Wait() {
t.mu.Lock()
- for t.count > t.threshold {
+ for t.count >= t.threshold {
t.cond.Wait()
}
t.mu.Unlock()
