semaphore: better error message when releasing more than held
Change-Id: Ibe69007b2d7565a33d9e64ae51142478f495509a Reviewed-on: https://go-review.googlesource.com/c/sync/+/173377 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Jonathan Amsterdam <jba@google.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
56d357773e
commit
112230192c
1 changed files with 1 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue