pub struct ActiveBarrier<'a> { /* private fields */ }Expand description
An ActiveBarrier can be used to generate checkpoints which must be cleared (usually by worker threads) before wait() and drop() unblock.
Implementations§
Source§impl<'a> ActiveBarrier<'a>
impl<'a> ActiveBarrier<'a>
Sourcepub fn checkpoint(&mut self) -> Checkpoint
pub fn checkpoint(&mut self) -> Checkpoint
Generate a new Checkpoint to be cleared.
§Panics
This function will panics if called more than n times.
Sourcepub fn finished(&self) -> bool
pub fn finished(&self) -> bool
Returns true if all checkpoints have been cleared and any calls to wait() or drop will not block.
Sourcepub fn wait(&self) -> WaitResult
pub fn wait(&self) -> WaitResult
Block thread until all checkpoints are cleared.
Returns a CheckpointPanic Err if a checkpoint is passed by a panicking thread.
Returns an InsufficientCheckpoints Err if less than n Checkpoints were generated.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ActiveBarrier<'a>
impl<'a> RefUnwindSafe for ActiveBarrier<'a>
impl<'a> Send for ActiveBarrier<'a>
impl<'a> Sync for ActiveBarrier<'a>
impl<'a> Unpin for ActiveBarrier<'a>
impl<'a> !UnwindSafe for ActiveBarrier<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more