diff --git a/pool.go b/pool.go index 9123572..6402be3 100644 --- a/pool.go +++ b/pool.go @@ -409,6 +409,7 @@ func (p *Pool) CreateResource(ctx context.Context) error { // If closed while constructing resource then destroy it and return an error if p.closed { go p.destructResourceValue(res.value) + p.cond.L.Unlock() return ErrClosedPool } p.allResources = append(p.allResources, res)