Skip to content

Commit

Permalink
semaphore: better error message when releasing more than held
Browse files Browse the repository at this point in the history
Change-Id: Ibe69007b2d7565a33d9e64ae51142478f495509a
Reviewed-on: https://go-review.googlesource.com/c/sync/+/173377
Reviewed-by: Brad Fitzpatrick <[email protected]>
Reviewed-by: Jonathan Amsterdam <[email protected]>
Run-TryBot: Brad Fitzpatrick <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
  • Loading branch information
jeanbza authored and bradfitz committed Apr 23, 2019
1 parent 56d3577 commit 1122301
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion semaphore/semaphore.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (s *Weighted) Release(n int64) {
s.cur -= n
if s.cur < 0 {
s.mu.Unlock()
panic("semaphore: bad release")
panic("semaphore: released more than held")
}
for {
next := s.waiters.Front()
Expand Down

0 comments on commit 1122301

Please sign in to comment.