From 04097af74dab4e8de21174b3c9ec9bb5b05464a6 Mon Sep 17 00:00:00 2001 From: Derek Parker Date: Tue, 25 Nov 2014 09:22:34 -0600 Subject: [PATCH] Avoid carrying closure around with goroutine --- proctl/proctl_linux_amd64.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proctl/proctl_linux_amd64.go b/proctl/proctl_linux_amd64.go index a7c57fba..3df67d6a 100644 --- a/proctl/proctl_linux_amd64.go +++ b/proctl/proctl_linux_amd64.go @@ -549,14 +549,14 @@ func timeoutWait(thread *ThreadContext, options int) (int, *syscall.WaitStatus, return 0, nil, nil } - go func(pid int) { + go func(pid int, statchan chan *waitstats, errchan chan error) { wpid, status, err := wait(pid, 0) if err != nil { errchan <- fmt.Errorf("wait err %s %d", err, pid) } statchan <- &waitstats{pid: wpid, status: status} - }(thread.Id) + }(thread.Id, statchan, errchan) select { case s := <-statchan: -- GitLab