mirror of https://github.com/panjf2000/ants.git
parent
36c4272286
commit
e01348e424
2
pool.go
2
pool.go
|
@ -244,8 +244,8 @@ func (p *Pool) retrieveWorker() (w *goWorker) {
|
|||
p.cond.Wait()
|
||||
p.blockingNum--
|
||||
if p.Running() == 0 {
|
||||
p.lock.Unlock()
|
||||
if !p.IsClosed() {
|
||||
p.lock.Unlock()
|
||||
spawnWorker()
|
||||
}
|
||||
return
|
||||
|
|
|
@ -262,8 +262,8 @@ func (p *PoolWithFunc) retrieveWorker() (w *goWorkerWithFunc) {
|
|||
p.cond.Wait()
|
||||
p.blockingNum--
|
||||
if p.Running() == 0 {
|
||||
p.lock.Unlock()
|
||||
if !p.IsClosed() {
|
||||
p.lock.Unlock()
|
||||
spawnWorker()
|
||||
}
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue