authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2025-10-11 09:59:58-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2025-10-11 10:01:17-04:00
log8efcfeaf1e6db6e26d31132bbd2eb3317d9749bf
treea666814c55617d816a96da9a90f6b9277fc13a70
parent923ddd94a1419abfa9ab95718a7b7d2a8da7a5ec

windows: workaround kernel race condition better

Until I can do more testing, we bump the numbers until morale improves.

2 files changed, 2 insertions(+), 2 deletions(-)

src/link.zig+1-1
...@@ -622,7 +622,7 @@ pub const File = struct {...@@ -622,7 +622,7 @@ pub const File = struct {
622 error.AccessDenied => switch (builtin.os.tag) {622 error.AccessDenied => switch (builtin.os.tag) {
623 .windows => {623 .windows => {
624 // give the kernel a chance to finish closing the executable handle624 // give the kernel a chance to finish closing the executable handle
625 std.os.windows.kernel32.Sleep(0);625 std.os.windows.kernel32.Sleep(1);
626 continue;626 continue;
627 },627 },
628 else => return error.AccessDenied,628 else => return error.AccessDenied,
test/standalone/windows_spawn/main.zig+1-1
...@@ -74,7 +74,7 @@ pub fn main() anyerror!void {...@@ -74,7 +74,7 @@ pub fn main() anyerror!void {
74 for (0..2) |_| break tmp.dir.rename("hello.exe", "hello") catch |err| switch (err) {74 for (0..2) |_| break tmp.dir.rename("hello.exe", "hello") catch |err| switch (err) {
75 error.AccessDenied => {75 error.AccessDenied => {
76 // give the kernel a chance to finish closing the executable handle76 // give the kernel a chance to finish closing the executable handle
77 std.os.windows.kernel32.Sleep(0);77 std.os.windows.kernel32.Sleep(1);
78 continue;78 continue;
79 },79 },
80 else => |e| return e,80 else => |e| return e,