MCPcopy
hub / github.com/grpc/grpc-go / acquire

Method acquire

server.go:2239–2244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2237}
2238
2239func (q *atomicSemaphore) acquire() {
2240 if q.n.Add(-1) < 0 {
2241 // We ran out of quota. Block until a release happens.
2242 <-q.wait
2243 }
2244}
2245
2246func (q *atomicSemaphore) release() {
2247 // N.B. the "<= 0" check below should allow for this to work with multiple

Callers 1

serveStreamsMethod · 0.80

Calls 1

AddMethod · 0.65

Tested by

no test coverage detected