diff --git a/src/link.zig b/src/link.zig index 9edd58109c3b90aa413b925508ff16dfe714d1d8..6863420d63fee102120a1fd4ee2b019c1933e041 100644 --- a/src/link.zig +++ b/src/link.zig @@ -622,7 +622,7 @@ pub const File = struct { error.AccessDenied => switch (builtin.os.tag) { .windows => { // give the kernel a chance to finish closing the executable handle - std.os.windows.kernel32.Sleep(0); + std.os.windows.kernel32.Sleep(1); continue; }, else => return error.AccessDenied, diff --git a/test/standalone/windows_spawn/main.zig b/test/standalone/windows_spawn/main.zig index 661c32aa5c0b0f7a34c5155e01cfb5d43d44390f..2b1a9c0c362488b31e0662cea2824caac2999ce8 100644 --- a/test/standalone/windows_spawn/main.zig +++ b/test/standalone/windows_spawn/main.zig @@ -74,7 +74,7 @@ pub fn main() anyerror!void { for (0..2) |_| break tmp.dir.rename("hello.exe", "hello") catch |err| switch (err) { error.AccessDenied => { // give the kernel a chance to finish closing the executable handle - std.os.windows.kernel32.Sleep(0); + std.os.windows.kernel32.Sleep(1); continue; }, else => |e| return e,