diff options
author | Valery Piashchynski <[email protected]> | 2021-12-14 13:21:12 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-12-14 14:15:45 +0300 |
commit | 634c3535856fb58eee5416f425a10e1c0bf46178 (patch) | |
tree | d4d203806a13e6efe251d9c1a91f657a224207b5 | |
parent | 253d7f7abf7a53b5249c08949372da5c9b687b04 (diff) |
protect destroy operation with mutexv2.6.1
Signed-off-by: Valery Piashchynski <[email protected]>
-rwxr-xr-x | pool/supervisor_pool.go | 4 |
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() { |