Struct scoped_pool::WaitGroup
[−]
[src]
pub struct WaitGroup { // some fields omitted }
A synchronization primitive for awaiting a set of actions.
Adding new jobs is done with submit
, jobs are completed with complete
,
and any thread may wait for all jobs to be complete
d with join
.
Methods
impl WaitGroup
[src]
fn new() -> Self
Create a new empty WaitGroup.
fn submit(&self)
Submit to this WaitGroup, causing join
to wait
for an additional complete
.
fn complete(&self)
Complete a previous submit
.
fn poison(&self)
Poison the WaitGroup so all join
ing threads panic.
fn join(&self)
Wait for submit
s to this WaitGroup to be complete
d.
Submits occuring completely before joins will always be waited on.
Submits occuring concurrently with a join
may or may not
be waited for.
Before submitting, join
will always return immediately.