std: implement sleep_until on Motor
This commit is contained in:
parent
9283d592de
commit
bd4211595d
2 changed files with 6 additions and 1 deletions
|
|
@ -135,6 +135,7 @@ cfg_select! {
|
|||
target_os = "vxworks",
|
||||
target_os = "wasi",
|
||||
target_vendor = "apple",
|
||||
target_os = "motor",
|
||||
)))]
|
||||
pub fn sleep_until(deadline: crate::time::Instant) {
|
||||
use crate::time::Instant;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use crate::io;
|
|||
use crate::num::NonZeroUsize;
|
||||
use crate::sys::map_motor_error;
|
||||
use crate::thread::ThreadInit;
|
||||
use crate::time::Duration;
|
||||
use crate::time::{Duration, Instant};
|
||||
|
||||
pub const DEFAULT_MIN_STACK_SIZE: usize = 1024 * 256;
|
||||
|
||||
|
|
@ -62,3 +62,7 @@ pub fn yield_now() {
|
|||
pub fn sleep(dur: Duration) {
|
||||
moto_rt::thread::sleep_until(moto_rt::time::Instant::now() + dur)
|
||||
}
|
||||
|
||||
pub fn sleep_until(deadline: Instant) {
|
||||
moto_rt::thread::sleep_until(deadline.into_inner())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue