authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2025-10-29 21:00:22-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2025-10-29 21:01:47-04:00
log1d80c9540af9b3c577c8cca740247b968e7e59f1
tree3ec2382e0396f91c67ac1497ff28d10c3fc4b804
parent767f28d7a631cc0e235dc3f6bbd260395a911010

Threaded: fix safety crashes


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

lib/std/Io/Threaded.zig+2-2
......@@ -2133,7 +2133,7 @@ pub fn dirOpenFileWtf16(
21332133 // incorrectly returned for an indeterminate amount of time
21342134 // after an executable file is closed. Here we work around the
21352135 // kernel bug with retry attempts.
2136 if (attempt - max_attempts == 0) return error.SharingViolation;
2136 if (max_attempts - attempt == 0) return error.SharingViolation;
21372137 _ = w.kernel32.SleepEx((@as(u32, 1) << attempt) >> 1, w.TRUE);
21382138 attempt += 1;
21392139 continue;
......@@ -2153,7 +2153,7 @@ pub fn dirOpenFileWtf16(
21532153 // finished with the deletion operation, and so this CreateFile
21542154 // call has failed. Here, we simulate the kernel bug being
21552155 // fixed by sleeping and retrying until the error goes away.
2156 if (attempt - max_attempts == 0) return error.SharingViolation;
2156 if (max_attempts - attempt == 0) return error.SharingViolation;
21572157 _ = w.kernel32.SleepEx((@as(u32, 1) << attempt) >> 1, w.TRUE);
21582158 attempt += 1;
21592159 continue;