(max uint32, new func() any)
| 18 | } |
| 19 | |
| 20 | func 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 | |
| 26 | func (p *WaitPool) Get() any { |
| 27 | if p.max != 0 { |
no outgoing calls