Struct avr_oxide::concurrency::sync::EventWait
source · pub struct EventWait { /* private fields */ }
Expand description
A simple synchronisation primitive that allows one or more threads to wait until an event is signalled by another the thread.
When the event occurs, the signalling thread may release one or all of the waiting threads.
Implementations§
source§impl EventWait
impl EventWait
sourcepub fn wait(&mut self)
pub fn wait(&mut self)
Block the calling thread waiting for an event to be signalled by another
thread calling one of the release()
methods.
sourcepub fn add_to_waitlist(&mut self, isotoken: Isolated)
pub fn add_to_waitlist(&mut self, isotoken: Isolated)
Add the calling thread to the wait list WITHOUT immediately blocking. Note that even though it will not immediately block, there is a possibility the caller will be pre-empted and blocked practically immediately anyway, so it is the caller’s responsbility to ensure they keep interrupts disabled for as long as they need to do anything before they yield.
sourcepub fn release_one(&mut self)
pub fn release_one(&mut self)
Release one waiting thread (if any)
sourcepub fn release_all(&mut self)
pub fn release_all(&mut self)
Release all waiting threads (if any)