From affcb8eaf73998d39aeb7499123d32d024c1f215 Mon Sep 17 00:00:00 2001 From: andy pan Date: Wed, 30 May 2018 12:59:00 +0800 Subject: [PATCH] Merge branch 'develop' --- pool.go | 2 ++ pool_func.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pool.go b/pool.go index 7224e3d..ee14834 100644 --- a/pool.go +++ b/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)) } diff --git a/pool_func.go b/pool_func.go index f8354d0..aac9889 100644 --- a/pool_func.go +++ b/pool_func.go @@ -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)) }