[][src]Trait yaar_lock::Event

pub unsafe trait Event: Sized + Default + Send + Sync {
    fn reset(&mut self);
fn wait(&self);
fn set(&self); }

Blocking event abstraction used to provide thread parking.

This allows for customization on how the thread should yield internally for platforms not supported by the library or for more efficient implementations.

Required methods

fn reset(&mut self)

Restore an event back to it's unset state. Since this owns the Event, it can be done without synchronization and could be potentially cheaper than dropping & creating a new Event.

fn wait(&self)

Wait for the Event to be set by another thread. If the event isn't set, this should block the current thread until it is. This will be used assuming an Acquire memory ordering.

fn set(&self)

Set the Event, waking up the thread that is waiting for it if any. This will be used assuming a Release memory ordering.

Loading content...

Implementors

impl Event for OsEvent[src]

Loading content...