pub async fn sys_nanosleep(&self, deadline: Deadline) -> ZxResult {
        info!("nanosleep: deadline={:?}", deadline);
        if deadline.0 <= 0 {
            kernel_hal::thread::yield_now().await;
        } else {
            let future = kernel_hal::thread::sleep_until(deadline.into());
            pin_mut!(future);
            self.thread
                .blocking_run(
                    future,
                    ThreadState::BlockedSleeping,
                    Deadline::forever().into(),
                    None,
                )
                .await?;
        }
        Ok(())
    }
/// Sleep for some number of nanoseconds.
///
/// A `deadline` value less than or equal to 0 immediately yields the thread.
Sleep for some number of nanoseconds.
A `deadline` value less than or equal to 0 immediately yields the thread.
Sleep for some number of nanoseconds . A ` deadline ` value less than or equal to 0 immediately yields the thread .
pub async fn sys_nanosleep(&self, deadline: Deadline) -> ZxResult {
        info!("nanosleep: deadline={:?}", deadline);
        if deadline.0 <= 0 {
            kernel_hal::thread::yield_now().await;
        } else {
            let future = kernel_hal::thread::sleep_until(deadline.into());
            pin_mut!(future);
            self.thread
                .blocking_run(
                    future,
                    ThreadState::BlockedSleeping,
                    Deadline::forever().into(),
                    None,
                )
                .await?;
        }
        Ok(())
    }
pub async fn sys_nanosleep ( & self , deadline : Deadline ) -> ZxResult { info ! ( " " deadline ) ; if deadline . 0 <= 0 { kernel_hal :: thread :: yield_now ( ) . await ; } else { let future = kernel_hal :: thread :: sleep_until ( deadline . into ( ) ) ; pin_mut ! ( future ) ; self . thread . blocking_run ( future , ThreadState :: BlockedSleeping , Deadline :: forever ( ) . into ( ) , None , ) . await ? ; } Ok ( ( ) ) }
Sleep for some number of nanoseconds.
Sleep for some number of nanoseconds .
&self
deadline
Deadline
&self
deadline
Deadline