Merge branch 'develop'

This commit is contained in:
andy pan 2018-05-30 12:59:14 +08:00
commit d5668ce8ad
2 changed files with 4 additions and 0 deletions

View File

@ -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))
} }

View File

@ -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))
} }