From eb64ebee3c77522202c5163513e7318bd630f8be Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Sun, 23 Sep 2018 15:50:57 +0300 Subject: task wait group protection added --- static_pool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static_pool.go b/static_pool.go index 432c9adc..be1a6f3b 100644 --- a/static_pool.go +++ b/static_pool.go @@ -150,9 +150,9 @@ func (p *StaticPool) Exec(rqs *Payload) (rsp *Payload, err error) { // Destroy all underlying workers (but let them to complete the task). func (p *StaticPool) Destroy() { atomic.AddInt32(&p.inDestroy, 1) - close(p.destroy) p.tmu.Lock() + close(p.destroy) p.tasks.Wait() p.tmu.Unlock() -- cgit v1.2.3