Skip to content

Commit

Permalink
os: remove sleep in windows Process.Wait
Browse files Browse the repository at this point in the history
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 golang#25965

Change-Id: I02094abee3592ce4fea98eaff9d15137dc54dc81
Reviewed-on: https://go-review.googlesource.com/c/145221
Run-TryBot: Alex Brainman <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
alexbrainman committed Oct 29, 2018
1 parent 1399b52 commit 5c35973
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/os/exec_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 5c35973

Please sign in to comment.