]> Cypherpunks.ru repositories - gostls13.git/commit
os: remove 5ms sleep on Windows in (*Process).Wait
authorqmuntal <quimmuntal@gmail.com>
Thu, 13 Jul 2023 14:40:49 +0000 (16:40 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Wed, 26 Jul 2023 15:13:24 +0000 (15:13 +0000)
commitf0894a00f4b756d4b9b4078af2e686b359493583
tree9193fa53624fed6f7c0cd293314aff44ebbd0576
parent4918490962ebda2b055bd1d160af9e9daa529522
os: remove 5ms sleep on Windows in (*Process).Wait

The 5ms sleep in (*Process).Wait was added to mitigate errors while
removing executable files using os.RemoveAll.

Windows 10 1903 implements POSIX semantics for DeleteFile, making the
implementation of os.RemoveAll on Windows much more robust. Older
Windows 10 versions also made internal improvements to avoid errors
when removing files, making it less likely that the 5ms sleep is
necessary.

Windows 10 is the oldest version that Go supports (see #57004), so it
makes sense to unconditionally remove the 5ms sleep now. We have all
the Go 1.22 development cycle to see if this causes any regression.

Fixes #25965

Change-Id: Ie0bbe6dc3e8389fd51a32484d5d20cf59b019451
Reviewed-on: https://go-review.googlesource.com/c/go/+/509335
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/os/exec_windows.go
src/os/exec_windows_test.go [new file with mode: 0644]