mirror of https://github.com/panjf2000/ants.git
update
This commit is contained in:
parent
afba560448
commit
339aaa4475
3
pool.go
3
pool.go
|
@ -76,9 +76,10 @@ func (p *Pool) monitorAndClear() {
|
||||||
n = i
|
n = i
|
||||||
w.stop()
|
w.stop()
|
||||||
idleWorkers[i] = nil
|
idleWorkers[i] = nil
|
||||||
|
p.running--
|
||||||
}
|
}
|
||||||
if n > 0 {
|
if n > 0 {
|
||||||
n += 1
|
n++
|
||||||
p.workers = idleWorkers[n:]
|
p.workers = idleWorkers[n:]
|
||||||
}
|
}
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
|
|
|
@ -77,6 +77,7 @@ func (p *PoolWithFunc) MonitorAndClear() {
|
||||||
n = i
|
n = i
|
||||||
w.stop()
|
w.stop()
|
||||||
idleWorkers[i] = nil
|
idleWorkers[i] = nil
|
||||||
|
p.running--
|
||||||
}
|
}
|
||||||
if n > 0 {
|
if n > 0 {
|
||||||
n += 1
|
n += 1
|
||||||
|
|
Loading…
Reference in New Issue