From 5c359736f8d67338b53c26aaef52139ae8cd0538 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Sun, 28 Oct 2018 14:45:12 +1100 Subject: [PATCH] os: remove sleep in windows Process.Wait The wait was there, because we discovered that we could not remove finished process executable without the wait on Windows XP. But Windows XP is not supported by Go. Maybe we do not need the wait with modern Windows versions. Remove the sleep. Fixes #25965 Change-Id: I02094abee3592ce4fea98eaff9d15137dc54dc81 Reviewed-on: https://go-review.googlesource.com/c/145221 Run-TryBot: Alex Brainman TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/os/exec_windows.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/os/exec_windows.go b/src/os/exec_windows.go index d5d553a2f6..86b52f69bf 100644 --- a/src/os/exec_windows.go +++ b/src/os/exec_windows.go @@ -35,11 +35,6 @@ func (p *Process) wait() (ps *ProcessState, err error) { return nil, NewSyscallError("GetProcessTimes", e) } p.setDone() - // NOTE(brainman): It seems that sometimes process is not dead - // when WaitForSingleObject returns. But we do not know any - // other way to wait for it. Sleeping for a while seems to do - // the trick sometimes. So we will sleep and smell the roses. - defer time.Sleep(5 * time.Millisecond) defer p.Release() return &ProcessState{p.Pid, syscall.WaitStatus{ExitCode: ec}, &u}, nil } -- 2.50.0