[][src]Trait embedded_executor::Sleep

pub trait Sleep: Default + Clone + Send + Sync + 'static {
    fn sleep(&self);
fn wake(&self); }

Platform-agnostic Sleep trait

Provides a mechanism to initialize a handle that can be used to either sleep or wake the current thread.

Intended usage is to create the sleep handle via the Default constructor, arrange for wake to be called on it when an event occurs, and then call sleep. The current thread should then be put into a sleep/low power/otherwise yielded state until wake gets called elsewhere.

Required methods

fn sleep(&self)

Put the current thread to sleep until Sleep::wake is called.

fn wake(&self)

Wake up sleeping threads

Currently unspecified as to whether this will wake up all, one, or some of potentially multiple sleeping threads.

Loading content...

Implementors

impl Sleep for SpinSleep
[src]

Loading content...