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