mirror of https://github.com/panjf2000/ants.git
Merge branch 'develop'
This commit is contained in:
commit
d5668ce8ad
2
pool.go
2
pool.go
|
@ -117,6 +117,8 @@ func (p *Pool) ReSize(size int) {
|
||||||
for i := 0; i < diff; i++ {
|
for i := 0; i < diff; i++ {
|
||||||
p.getWorker().stop()
|
p.getWorker().stop()
|
||||||
}
|
}
|
||||||
|
} else if size == p.Cap() {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
atomic.StoreInt32(&p.capacity, int32(size))
|
atomic.StoreInt32(&p.capacity, int32(size))
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,6 +122,8 @@ func (p *PoolWithFunc) ReSize(size int) {
|
||||||
for i := 0; i < diff; i++ {
|
for i := 0; i < diff; i++ {
|
||||||
p.getWorker().stop()
|
p.getWorker().stop()
|
||||||
}
|
}
|
||||||
|
} else if size == p.Cap(){
|
||||||
|
return
|
||||||
}
|
}
|
||||||
atomic.StoreInt32(&p.capacity, int32(size))
|
atomic.StoreInt32(&p.capacity, int32(size))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue