forked from mirror/ants
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 {
|
||||
if !p.IsClosed() {
|
||||
p.lock.Unlock()
|
||||
if !p.IsClosed() {
|
||||
spawnWorker()
|
||||
}
|
||||
return
|
||||
|
|
|
@ -262,8 +262,8 @@ func (p *PoolWithFunc) retrieveWorker() (w *goWorkerWithFunc) {
|
|||
p.cond.Wait()
|
||||
p.blockingNum--
|
||||
if p.Running() == 0 {
|
||||
if !p.IsClosed() {
|
||||
p.lock.Unlock()
|
||||
if !p.IsClosed() {
|
||||
spawnWorker()
|
||||
}
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue