| ... | ... | @@ -251,7 +251,11 @@ const Closure = struct { |
| 251 | 251 | .sec = 0, |
| 252 | 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 | } |
| 255 | 259 | |
| 256 | 260 | switch (@atomicRmw(CancelStatus, &closure.cancel_status, .Xchg, .requested, .monotonic).unpack()) { |
| 257 | 261 | .requested => continue, // Retry needed in case other thread hasn't yet entered the syscall. |