mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
std.Io.Threaded: handle TIMEOUT from NtDelayExceution
This commit is contained in:
parent
f8828e543a
commit
866ee4f1c5
2 changed files with 8 additions and 1 deletions
|
|
@ -2761,7 +2761,7 @@ fn batchWaitWindows(t: *Threaded, b: *Io.Batch, timeout: Io.Timeout) Io.Batch.Wa
|
|||
const delay_rc = windows.ntdll.NtDelayExecution(windows.TRUE, &delay_interval);
|
||||
alertable_syscall.finish();
|
||||
switch (delay_rc) {
|
||||
.SUCCESS => {
|
||||
.SUCCESS, .TIMEOUT => {
|
||||
// The thread woke due to the timeout. Although spurious
|
||||
// timeouts are OK, when no deadline is passed we must not
|
||||
// return `error.Timeout`.
|
||||
|
|
|
|||
|
|
@ -594,6 +594,13 @@ pub extern "ntdll" fn NtCancelSynchronousIoFile(
|
|||
IoStatusBlock: *IO_STATUS_BLOCK,
|
||||
) callconv(.winapi) NTSTATUS;
|
||||
|
||||
/// This function has been observed to return SUCCESS on timeout on Windows 10
|
||||
/// and TIMEOUT on Wine 10.0.
|
||||
///
|
||||
/// This function has been observed on Windows 11 such that positive interval
|
||||
/// is real time, which can cause waits to be interrupted by changing system
|
||||
/// time, however negative intervals are not affected by changes to system
|
||||
/// time.
|
||||
pub extern "ntdll" fn NtDelayExecution(
|
||||
Alertable: BOOLEAN,
|
||||
DelayInterval: *const LARGE_INTEGER,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue