mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
std.Io.Threaded: handle TIMEOUT from NtDelayExceution
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user