Struct pool_barrier::Barrier
[−]
[src]
pub struct Barrier { /* fields omitted */ }
A stack allocated synchronisation barrier. See crate doc for use.
Methods
impl Barrier
[src]
fn new(n: usize) -> Barrier
Create a new barrier
n
: the exact number of checkpoints to be generated, all of which must be cleared beforewait()
unblocks
fn set_n(&mut self, n: usize)
Change the number of checkpoints that have to be cleared on the next barrier activation.
fn activate<'a>(&'a mut self) -> ActiveBarrier<'a>
Activate the barrier producing an ActiveBarrier. The returned ActiveBarrier can then produce checkpoints which may be passed to worker threads, and will block on wait() or drop() until checkpoints are cleared.
fn n(&self) -> usize
The number of Checkpoint
s that must be generated and cleared each time the barrier is activated.