Skip to content

Commit

Permalink
fix off-by-one error in the threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Jan 23, 2018
1 parent 6b92f28 commit be4a5f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/net/upgrader/threshold.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit be4a5f4

Please sign in to comment.