zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 8efcfeaf1e6db6e26d31132bbd2eb3317d9749bf (tree)
parent 923ddd94a1419abfa9ab95718a7b7d2a8da7a5ec
Author: Jacob Young <jacobly0@users.noreply.github.com>
Date:   Sat, 11 Oct 2025 09:59:58 -0400

windows: workaround kernel race condition better

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

Diffstat:
Msrc/link.zig | 2+-
Mtest/standalone/windows_spawn/main.zig | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 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 @@ -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,