Skip to content

Commit

Permalink
server: fix semaphore release for counting max concurrent streams (#6737
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bboreham authored Oct 18, 2023
1 parent b4c2f6e commit 4652392
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2093,7 +2093,7 @@ func (q *atomicSemaphore) release() {
// concurrent calls to acquire, but also note that with synchronous calls to
// acquire, as our system does, n will never be less than -1. There are
// fairness issues (queuing) to consider if this was to be generalized.
if atomic.AddInt64(&q.n, -1) <= 0 {
if atomic.AddInt64(&q.n, 1) <= 0 {
// An acquire was waiting on us. Unblock it.
q.wait <- struct{}{}
}
Expand Down

0 comments on commit 4652392

Please sign in to comment.