Struct wait_group::WaitGroup
[−]
[src]
pub struct WaitGroup(_);
A WaitGroup waits for a collection of threads to finish. Then each of the threads runs and calls Done when finished. At the same time, Wait can be used to block until all threads have finished.
Example
use std::thread; let wg = wait_group::WaitGroup::new(); for _ in 0..10 { wg.add(1); let wg2 = wg.clone(); thread::spawn(move || { // do something // call done wg2.done(); }); } // block until all threads have finished wg.wait();
Methods
impl WaitGroup
[src]
Trait Implementations
impl Clone for WaitGroup
[src]
fn clone(&self) -> WaitGroup
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more