提交 04097af7 编写于 作者: D Derek Parker

Avoid carrying closure around with goroutine

上级 36d3ecd6
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册