diff --git a/pool.go b/pool.go index d2b817d..b51456f 100644 --- a/pool.go +++ b/pool.go @@ -200,7 +200,7 @@ func (p *Pool) Tune(size int) { } // Release Closes this pool. -func (p *Pool) Release() error { +func (p *Pool) Release() { p.once.Do(func() { atomic.StoreInt32(&p.release, 1) p.lock.Lock() @@ -212,7 +212,6 @@ func (p *Pool) Release() error { p.workers = nil p.lock.Unlock() }) - return nil } //--------------------------------------------------------------------------- diff --git a/pool_func.go b/pool_func.go index e8a8f00..c772de6 100644 --- a/pool_func.go +++ b/pool_func.go @@ -205,7 +205,7 @@ func (p *PoolWithFunc) Tune(size int) { } // Release Closed this pool. -func (p *PoolWithFunc) Release() error { +func (p *PoolWithFunc) Release() { p.once.Do(func() { atomic.StoreInt32(&p.release, 1) p.lock.Lock() @@ -217,7 +217,6 @@ func (p *PoolWithFunc) Release() error { p.workers = nil p.lock.Unlock() }) - return nil } //---------------------------------------------------------------------------