We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
usleep
u64::MAX
1 parent fdb5fc1 commit c688defCopy full SHA for c688def
std/src/sys/pal/hermit/thread.rs
@@ -78,9 +78,10 @@ impl Thread {
78
#[inline]
79
pub fn sleep(dur: Duration) {
80
let micros = dur.as_micros() + if dur.subsec_nanos() % 1_000 > 0 { 1 } else { 0 };
81
+ let micros = u64::try_from(micros).unwrap_or(u64::MAX);
82
83
unsafe {
- hermit_abi::usleep(micros as u64);
84
+ hermit_abi::usleep(micros);
85
}
86
87
0 commit comments