Struct pool_barrier::ActiveBarrier
[−]
[src]
pub struct ActiveBarrier<'a> { /* fields omitted */ }
An ActiveBarrier can be used to generate checkpoints which must be cleared (usually by worker threads) before wait()
and drop()
unblock.
Methods
impl<'a> ActiveBarrier<'a>
[src]
fn checkpoint(&mut self) -> Checkpoint
Generate a new Checkpoint
to be cleared.
Panics
This function will panics if called more than n
times.
fn finished(&self) -> bool
Returns true if all checkpoints have been cleared and any calls to wait()
or drop
will not block.
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
Checkpoint
s were generated.
fn n(&self) -> usize
The number of Checkpoint
s that must be generated and cleared each time the barrier is activated.