Skip to content

Commit 1122301

Browse files
jeanbzabradfitz
authored andcommitted
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>
1 parent 56d3577 commit 1122301

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

semaphore/semaphore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func (s *Weighted) Release(n int64) {
9595
s.cur -= n
9696
if s.cur < 0 {
9797
s.mu.Unlock()
98-
panic("semaphore: bad release")
98+
panic("semaphore: released more than held")
9999
}
100100
for {
101101
next := s.waiters.Front()

0 commit comments

Comments
 (0)