summaryrefslogtreecommitdiff
path: root/static_pool.go
diff options
context:
space:
mode:
Diffstat (limited to 'static_pool.go')
-rw-r--r--static_pool.go2
1 files changed, 1 insertions, 1 deletions
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()