You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func (p *Pool) Close() {
...
for _, res := range **p.idleResources** {
p.allResources = removeResource(p.allResources, res)
go p.destructResourceValue(res.value)
}
// Different WaitGroup counter
...
**p.destructWG.Wait()**
// process freezes because
// len(p.idleResources) != len(p.allResources)
}
The easiest way to solve:
func (p *Pool) Close() {
for _, res := range **p.idleResources** {
p.allResources = removeResource(p.allResources, res)
go p.destructResourceValue(res.value)
}
for _, res := range p.allResources {
p.allResources = removeResource(p.allResources, res)
p.destructWG.Done()
}
...
}
The text was updated successfully, but these errors were encountered:
Hi.
pool.go
The easiest way to solve:
...
}
The text was updated successfully, but these errors were encountered: