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 687c8a1 commit edeefc5Copy full SHA for edeefc5
library/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