Function

dispatch_group_create

Creates a new group to which you can assign block objects.

Declaration

dispatch_group_t dispatch_group_create(void);

Return Value

The newly created group, or NULL on failure.

Discussion

This function creates a new group with which block objects can be associated (by using the dispatch_group_async function). The dispatch group maintains a count of its outstanding associated tasks, incrementing the count when a new task is associated and decrementing it when a task completes. Functions such as dispatch_group_notify and dispatch_group_wait use that count to allow your application to determine when all tasks associated with the group have completed. At that time, your application can take any appropriate action.

See Also

Creating a Dispatch Group

dispatch_group_t

A group of block objects submitted to a queue for asynchronous invocation.