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