update codecov test

This commit is contained in:
Andy Pan 2018-07-16 02:43:38 +08:00
parent d31b2413c6
commit 4553a7a1c6
2 changed files with 8 additions and 10 deletions

View File

@ -145,14 +145,13 @@ func (p *Pool) Cap() int {
func (p *Pool) ReSize(size int) {
if size == p.Cap() {
return
} else if size < p.Cap() {
diff := p.Cap() - size
atomic.StoreInt32(&p.capacity, int32(size))
}
atomic.StoreInt32(&p.capacity, int32(size))
diff := p.Running() - size
if diff > 0 {
for i := 0; i < diff; i++ {
p.getWorker().task <- nil
}
} else {
atomic.StoreInt32(&p.capacity, int32(size))
}
}

View File

@ -150,14 +150,13 @@ func (p *PoolWithFunc) Cap() int {
func (p *PoolWithFunc) ReSize(size int) {
if size == p.Cap() {
return
} else if size < p.Cap() {
diff := p.Cap() - size
atomic.StoreInt32(&p.capacity, int32(size))
}
atomic.StoreInt32(&p.capacity, int32(size))
diff := p.Running() - size
if diff > 0 {
for i := 0; i < diff; i++ {
p.getWorker().args <- nil
}
} else {
atomic.StoreInt32(&p.capacity, int32(size))
}
}