authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-23 00:03:37-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-30 12:10:01-08:00
log29f44952c118be655e152b8f6c4ae78a0cc619a9
tree7db4cf483171c8241d7d6ea51760bd272dd0199f
parent9240881806ef23c504d0312ed7f89f3b5c48aaf3

std.Io.Threaded: fix NtDelayExecution delay interval


1 files changed, 3 insertions(+), 3 deletions(-)

lib/std/Io/Threaded.zig+3-3
......@@ -8372,7 +8372,7 @@ fn fileReadStreamingWindows(file: File, data: []const []u8) File.Reader.Error!us
83728372
83738373 var io_status_block: windows.IO_STATUS_BLOCK = undefined;
83748374 var done: bool = false;
8375 const infinite: windows.LARGE_INTEGER = windows.INFINITE;
8375 const max_delay_interval: windows.LARGE_INTEGER = std.math.minInt(i64);
83768376
83778377 read: {
83788378 const syscall: Syscall = try .start();
......@@ -8404,7 +8404,7 @@ fn fileReadStreamingWindows(file: File, data: []const []u8) File.Reader.Error!us
84048404 // Once we get here we received PENDING so we must not return from the
84058405 // function until the operation completes.
84068406 defer while (!done) {
8407 _ = windows.ntdll.NtDelayExecution(1, &infinite);
8407 _ = windows.ntdll.NtDelayExecution(1, &max_delay_interval);
84088408 };
84098409
84108410 const alertable_syscall = syscall.toAlertable() catch |err| switch (err) {
......@@ -8415,7 +8415,7 @@ fn fileReadStreamingWindows(file: File, data: []const []u8) File.Reader.Error!us
84158415 };
84168416 defer alertable_syscall.finish();
84178417 while (!done) {
8418 _ = windows.ntdll.NtDelayExecution(1, &infinite);
8418 _ = windows.ntdll.NtDelayExecution(1, &max_delay_interval);
84198419 alertable_syscall.checkCancel() catch |err| switch (err) {
84208420 error.Canceled => |e| {
84218421 _ = windows.ntdll.NtCancelIoFile(file.handle, &io_status_block);