From 909660ea923d9baf8f71351962a72b34fac7a91f Mon Sep 17 00:00:00 2001 From: Iceber Gu Date: Wed, 21 Apr 2021 18:24:18 +0800 Subject: [PATCH] process: use the unbuffered channel as the done signal Signed-off-by: Iceber Gu --- pkg/process/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/process/utils.go b/pkg/process/utils.go index 444dbb657..6536ac5a8 100644 --- a/pkg/process/utils.go +++ b/pkg/process/utils.go @@ -172,7 +172,7 @@ func (p *pidFile) Read() (int, error) { func waitTimeout(ctx context.Context, wg *sync.WaitGroup, timeout time.Duration) error { ctx, cancel := context.WithTimeout(ctx, timeout) defer cancel() - done := make(chan struct{}, 1) + done := make(chan struct{}) go func() { wg.Wait() close(done)