forked from mirror/ants
Merge branch 'master' into develop
This commit is contained in:
commit
418888be9d
2
pool.go
2
pool.go
|
@ -146,12 +146,10 @@ func (p *Pool) ReSize(size int) {
|
|||
}
|
||||
atomic.StoreInt32(&p.capacity, int32(size))
|
||||
diff := p.Running() - size
|
||||
if diff > 0 {
|
||||
for i := 0; i < diff; i++ {
|
||||
p.getWorker().task <- nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Release Closes this pool.
|
||||
func (p *Pool) Release() error {
|
||||
|
|
|
@ -148,12 +148,10 @@ func (p *PoolWithFunc) ReSize(size int) {
|
|||
}
|
||||
atomic.StoreInt32(&p.capacity, int32(size))
|
||||
diff := p.Running() - size
|
||||
if diff > 0 {
|
||||
for i := 0; i < diff; i++ {
|
||||
p.getWorker().args <- nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Release Closed this pool.
|
||||
func (p *PoolWithFunc) Release() error {
|
||||
|
|
Loading…
Reference in New Issue