optimization for releasing pool

This commit is contained in:
andy pan 2018-06-22 11:42:05 +08:00
parent c74267de7d
commit e64217c364
2 changed files with 6 additions and 0 deletions

View File

@ -106,6 +106,9 @@ func (p *Pool) Release() error {
for i := 0; i < running; i++ {
p.getWorker().stop()
}
for i := range p.workers{
p.workers[i] = nil
}
})
return nil
}

View File

@ -111,6 +111,9 @@ func (p *PoolWithFunc) Release() error {
for i := 0; i < running; i++ {
p.getWorker().stop()
}
for i := range p.workers{
p.workers[i] = nil
}
})
return nil
}