| ... | @@ -8444,6 +8444,7 @@ fn fileReadStreamingWindows(file: File, data: []const []u8) File.Reader.Error!us | ... | @@ -8444,6 +8444,7 @@ fn fileReadStreamingWindows(file: File, data: []const []u8) File.Reader.Error!us |
| 8444 | | 8444 | |
| 8445 | var io_status_block: windows.IO_STATUS_BLOCK = undefined; | 8445 | var io_status_block: windows.IO_STATUS_BLOCK = undefined; |
| 8446 | var done: bool = false; | 8446 | var done: bool = false; |
| | 8447 | const infinite: windows.LARGE_INTEGER = windows.INFINITE; |
| 8447 | | 8448 | |
| 8448 | read: { | 8449 | read: { |
| 8449 | const syscall: Syscall = try .start(); | 8450 | const syscall: Syscall = try .start(); |
| ... | @@ -8472,7 +8473,7 @@ fn fileReadStreamingWindows(file: File, data: []const []u8) File.Reader.Error!us | ... | @@ -8472,7 +8473,7 @@ fn fileReadStreamingWindows(file: File, data: []const []u8) File.Reader.Error!us |
| 8472 | } | 8473 | } |
| 8473 | try syscall.toApc(.{ .handle = file.handle, .iosb = &io_status_block }); | 8474 | try syscall.toApc(.{ .handle = file.handle, .iosb = &io_status_block }); |
| 8474 | while (true) { | 8475 | while (true) { |
| 8475 | switch (windows.ntdll.NtDelayExecution(1, null)) { | 8476 | switch (windows.ntdll.NtDelayExecution(1, &infinite)) { |
| 8476 | .USER_APC => { | 8477 | .USER_APC => { |
| 8477 | if (!done) { | 8478 | if (!done) { |
| 8478 | // Other APC work was queued before calling into this function. | 8479 | // Other APC work was queued before calling into this function. |
| ... | @@ -8481,7 +8482,7 @@ fn fileReadStreamingWindows(file: File, data: []const []u8) File.Reader.Error!us | ... | @@ -8481,7 +8482,7 @@ fn fileReadStreamingWindows(file: File, data: []const []u8) File.Reader.Error!us |
| 8481 | } | 8482 | } |
| 8482 | break syscall.finishApc(); | 8483 | break syscall.finishApc(); |
| 8483 | }, | 8484 | }, |
| 8484 | .SUCCESS, .CANCELLED => { | 8485 | .SUCCESS, .CANCELLED, .TIMEOUT, .ALERTED => { |
| 8485 | try syscall.checkCancelApc(); | 8486 | try syscall.checkCancelApc(); |
| 8486 | continue; | 8487 | continue; |
| 8487 | }, | 8488 | }, |