DispatchGroup.Wait Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.