pub struct WaitGroup { /* private fields */ }
Expand description

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 completed with join.

Implementations

Create a new empty WaitGroup.

How many submitted tasks are waiting for completion.

Submit to this WaitGroup, causing join to wait for an additional complete.

Complete a previous submit.

Poison the WaitGroup so all joining threads panic.

Wait for submits to this WaitGroup to be completed.

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.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.