mirror of
https://github.com/panjf2000/ants.git
synced 2025-12-18 19:31:02 +00:00
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…
x
Reference in New Issue
Block a user