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-27 15:32:34-08:00
log041add45ad37522f1b3dea8daec0808b5dc55d1d
treeda22d57fa1f7b1eb9a952c63bede537b389bf46b
parent79be6b7ffe6170cd6560637c2eaed0bc8dc96354

std.Io.Threaded: fix NtDelayExecution delay interval


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

lib/std/Io/Threaded.zig+3-3
......@@ -8229,7 +8229,7 @@ fn fileReadStreamingWindows(file: File, data: []const []u8) File.Reader.Error!us
82298229
82308230 var io_status_block: windows.IO_STATUS_BLOCK = undefined;
82318231 var done: bool = false;
8232 const infinite: windows.LARGE_INTEGER = windows.INFINITE;
8232 const max_delay_interval: windows.LARGE_INTEGER = std.math.minInt(i64);
82338233
82348234 read: {
82358235 const syscall: Syscall = try .start();
......@@ -8261,7 +8261,7 @@ fn fileReadStreamingWindows(file: File, data: []const []u8) File.Reader.Error!us
82618261 // Once we get here we received PENDING so we must not return from the
82628262 // function until the operation completes.
82638263 defer while (!done) {
8264 _ = windows.ntdll.NtDelayExecution(1, &infinite);
8264 _ = windows.ntdll.NtDelayExecution(1, &max_delay_interval);
82658265 };
82668266
82678267 const alertable_syscall = syscall.toAlertable() catch |err| switch (err) {
......@@ -8272,7 +8272,7 @@ fn fileReadStreamingWindows(file: File, data: []const []u8) File.Reader.Error!us
82728272 };
82738273 defer alertable_syscall.finish();
82748274 while (!done) {
8275 _ = windows.ntdll.NtDelayExecution(1, &infinite);
8275 _ = windows.ntdll.NtDelayExecution(1, &max_delay_interval);
82768276 alertable_syscall.checkCancel() catch |err| switch (err) {
82778277 error.Canceled => |e| {
82788278 _ = windows.ntdll.NtCancelIoFile(file.handle, &io_status_block);