mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
std.Io.Threaded: fix compilation for riscv32-linux
This commit is contained in:
parent
9e981c3ae5
commit
144206856e
1 changed files with 5 additions and 1 deletions
|
|
@ -251,7 +251,11 @@ const Closure = struct {
|
|||
.sec = 0,
|
||||
.nsec = @as(isize, 1) << @intCast(attempt_index),
|
||||
};
|
||||
_ = posix.system.nanosleep(×pec, ×pec);
|
||||
if (native_os == .linux) {
|
||||
_ = std.os.linux.clock_nanosleep(posix.CLOCK.MONOTONIC, .{ .ABSTIME = false }, ×pec, ×pec);
|
||||
} else {
|
||||
_ = posix.system.nanosleep(×pec, ×pec);
|
||||
}
|
||||
|
||||
switch (@atomicRmw(CancelStatus, &closure.cancel_status, .Xchg, .requested, .monotonic).unpack()) {
|
||||
.requested => continue, // Retry needed in case other thread hasn't yet entered the syscall.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue