Skip to content

Implement sleeping against non-monotonic clocks #230

@arihant2math

Description

@arihant2math

Currently moss support sleeping against the wall time:

pub async fn sleep(duration: Duration) {
// A sleep of zero duration returns now.
if duration.is_zero() {
return;
}
if let Some(timer) = SYS_TIMER.get() {
timer.sleep(duration).await;
}
}

But we'd also need to be able to sleep against CLOCK_REALTIME, CLOCK_PROCESS_CPUTIME_ID, and CLOCK_THREAD_CPUTIME_ID, to properly implement sys_clock_nanosleep, timer_create, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions