diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig index ff2e0436ccd34f418c3c859bd76c3faa39d8f719..8e55590b3e31910d9f910ddcc361d2103131cf61 100644 --- a/lib/std/Io/Threaded.zig +++ b/lib/std/Io/Threaded.zig @@ -8229,7 +8229,7 @@ fn fileReadStreamingWindows(file: File, data: []const []u8) File.Reader.Error!us var io_status_block: windows.IO_STATUS_BLOCK = undefined; var done: bool = false; - const infinite: windows.LARGE_INTEGER = windows.INFINITE; + const max_delay_interval: windows.LARGE_INTEGER = std.math.minInt(i64); read: { const syscall: Syscall = try .start(); @@ -8261,7 +8261,7 @@ fn fileReadStreamingWindows(file: File, data: []const []u8) File.Reader.Error!us // Once we get here we received PENDING so we must not return from the // function until the operation completes. defer while (!done) { - _ = windows.ntdll.NtDelayExecution(1, &infinite); + _ = windows.ntdll.NtDelayExecution(1, &max_delay_interval); }; const alertable_syscall = syscall.toAlertable() catch |err| switch (err) { @@ -8272,7 +8272,7 @@ fn fileReadStreamingWindows(file: File, data: []const []u8) File.Reader.Error!us }; defer alertable_syscall.finish(); while (!done) { - _ = windows.ntdll.NtDelayExecution(1, &infinite); + _ = windows.ntdll.NtDelayExecution(1, &max_delay_interval); alertable_syscall.checkCancel() catch |err| switch (err) { error.Canceled => |e| { _ = windows.ntdll.NtCancelIoFile(file.handle, &io_status_block);