Edit

Share via


DispatchGroup.Wait Method

Definition

Overloads

Wait(DispatchTime)

Waits synchronously for all blocks in the group to complete or the specified timeout has elapsed.

Wait(TimeSpan)

Wait(DispatchTime)

Waits synchronously for all blocks in the group to complete or the specified timeout has elapsed.

public bool Wait (CoreFoundation.DispatchTime timeout);
member this.Wait : CoreFoundation.DispatchTime -> bool

Parameters

timeout
DispatchTime

A DispatchTime that represents the number of nanoseconds to wait.

Returns

true if all code blockes finished before timeout otherwise false.

Remarks

This function waits for the completion of the blocks associated with the given dispatch group, and returns after all blocks have completed or when the specified timeout has elapsed.

This function will return immediately if there are no blocks associated with the dispatch group (i.e. the group is empty).

The result of calling this function from multiple threads simultaneously with the same dispatch group is undefined.

After the successful return of this function, the dispatch group is empty.

Applies to

Wait(TimeSpan)

public bool Wait (TimeSpan timeout);
member this.Wait : TimeSpan -> bool

Parameters

timeout
TimeSpan

Returns

Applies to