# 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`

#### `fn new() -> Self`

Create a new empty WaitGroup.

#### `fn waiting(&self) -> usize`

How many submitted tasks are waiting for completion.

#### `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.

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)