From aa0e8cd5bcf39031feda870c0f5359dab038c916 Mon Sep 17 00:00:00 2001 From: Dmitriy Matrenichev Date: Sat, 11 Sep 2021 02:15:45 +0300 Subject: [PATCH] Fix deadlock in Pool.CreateResource --- pool.go | 1 + 1 file changed, 1 insertion(+) 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)