mirror of https://github.com/panjf2000/ants.git
optimization for releasing pool
This commit is contained in:
parent
c74267de7d
commit
e64217c364
3
pool.go
3
pool.go
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue