summaryrefslogtreecommitdiff
path: root/pool/supervisor_pool.go
diff options
context:
space:
mode:
Diffstat (limited to 'pool/supervisor_pool.go')
-rwxr-xr-xpool/supervisor_pool.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pool/supervisor_pool.go b/pool/supervisor_pool.go
index b01520e2..3dbae417 100755
--- a/pool/supervisor_pool.go
+++ b/pool/supervisor_pool.go
@@ -87,8 +87,10 @@ func (sp *supervised) RemoveWorker(worker worker.BaseProcess) error {
}
func (sp *supervised) Destroy(ctx context.Context) {
- sp.pool.Destroy(ctx)
sp.Stop()
+ sp.mu.Lock()
+ sp.pool.Destroy(ctx)
+ sp.mu.Unlock()
}
func (sp *supervised) Start() {