MCPcopy Create free account
hub / github.com/encodeous/nylon / NewWaitPool

Function NewWaitPool

polyamide/device/pools.go:20–24  ·  view source on GitHub ↗
(max uint32, new func() any)

Source from the content-addressed store, hash-verified

18}
19
20func NewWaitPool(max uint32, new func() any) *WaitPool {
21 p := &WaitPool{pool: sync.Pool{New: new}, max: max}
22 p.cond = sync.Cond{L: &p.lock}
23 return p
24}
25
26func (p *WaitPool) Get() any {
27 if p.max != 0 {

Callers 4

PopulatePoolsMethod · 0.85
TestWaitPoolFunction · 0.85
BenchmarkWaitPoolFunction · 0.85
BenchmarkWaitPoolEmptyFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestWaitPoolFunction · 0.68
BenchmarkWaitPoolFunction · 0.68
BenchmarkWaitPoolEmptyFunction · 0.68