]> Cypherpunks repositories - gostls13.git/commitdiff
os: remove sleep in windows Process.Wait
authorAlex Brainman <alex.brainman@gmail.com>
Sun, 28 Oct 2018 03:45:12 +0000 (14:45 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Mon, 29 Oct 2018 09:04:07 +0000 (09:04 +0000)
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 <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/os/exec_windows.go

index d5d553a2f6b33d6098ff0979a1abc6fc7b7f6a82..86b52f69bf976c4ddd5d09391177d07b9f4f5bfe 100644 (file)
@@ -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
 }