Skip to content

Commit

Permalink
task wait group protection added
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy-j committed Sep 23, 2018
1 parent 0d826d2 commit eb64ebe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion static_pool.go
Expand Up @@ -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()

Expand Down

0 comments on commit eb64ebe

Please sign in to comment.