/// Drops this reference and waits until all other references are dropped.
///
/// # Examples
///
/// ```
/// use crossbeam_utils::sync::WaitGroup;
/// use std::thread;
///
/// let wg = WaitGroup::new();
///
/// thread::spawn({
///     let wg = wg.clone();
///     move || {
///         // Block until both threads have reached `wait()`.
///         wg.wait();
///     }
/// });
///
/// // Block until both threads have reached `wait()`.
/// wg.wait();
/// ```
Drops this reference and waits until all other references are dropped.
Drops this reference and waits until all other references are dropped .
pub fn wait(self) {
        if *self.inner.count.lock() == 1 {
            return;
        }
        let inner = self.inner.clone();
        drop(self);
        let mut count = inner.count.lock();
        while *count > 0 {
            inner.cvar.wait(&mut count);
        }
    }
pub fn wait ( self ) { if * self . inner . count . lock ( ) == 1 { return ; } let inner = self . inner . clone ( ) ; drop ( self ) ; let mut count = inner . count . lock ( ) ; while * count > 0 { inner . cvar . wait ( & mut count ) ; } }
Drops this reference and waits until all other references are dropped.
Drops this reference and waits until all other references are dropped .
self
examples
```
use crossbeam_utils::sync::WaitGroup;
use std::thread.

let wg = WaitGroup::new().

:spawn({
let wg = wg.clone();
move || {
Block until both threads have reached `wait()`.

Block until both threads have reached `wait()`.
` ` ` use crossbeam_utils :: sync :: WaitGroup ; use std :: thread . let wg = WaitGroup :: new () . : spawn ( { let wg = wg . clone () ; move || { Block until both threads have reached ` wait () ` . Block until both threads have reached ` wait () ` .