summaryrefslogtreecommitdiff
path: root/static_pool.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-09-23 15:50:57 +0300
committerWolfy-J <[email protected]>2018-09-23 15:50:57 +0300
commiteb64ebee3c77522202c5163513e7318bd630f8be (patch)
treedef759b509dbd32569afc8229c8888fa6599e1bf /static_pool.go
parent0d826d29d27cdc83766ceb60c33444603f67ade1 (diff)
task wait group protection added
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()