authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-11-29 07:52:32-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-12-01 19:17:52-08:00
log144206856e26300cc814b3c894527b062db0e69f
tree745a460f68215ff45a3b0222dbfae9cba828c054
parent9e981c3ae517738eacc0456632651aae5626d109

std.Io.Threaded: fix compilation for riscv32-linux


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

lib/std/Io/Threaded.zig+5-1
...@@ -251,7 +251,11 @@ const Closure = struct {...@@ -251,7 +251,11 @@ const Closure = struct {
251 .sec = 0,251 .sec = 0,
252 .nsec = @as(isize, 1) << @intCast(attempt_index),252 .nsec = @as(isize, 1) << @intCast(attempt_index),
253 };253 };
254 _ = posix.system.nanosleep(&timespec, &timespec);254 if (native_os == .linux) {
255 _ = std.os.linux.clock_nanosleep(posix.CLOCK.MONOTONIC, .{ .ABSTIME = false }, &timespec, &timespec);
256 } else {
257 _ = posix.system.nanosleep(&timespec, &timespec);
258 }
255259
256 switch (@atomicRmw(CancelStatus, &closure.cancel_status, .Xchg, .requested, .monotonic).unpack()) {260 switch (@atomicRmw(CancelStatus, &closure.cancel_status, .Xchg, .requested, .monotonic).unpack()) {
257 .requested => continue, // Retry needed in case other thread hasn't yet entered the syscall.261 .requested => continue, // Retry needed in case other thread hasn't yet entered the syscall.