A dispatch group is an association of one or more blocks submitted to dispatch
queues for asynchronous invocation.
Applications may use dispatch groups to
wait for the completion of blocks associated with the group.
function returns a new and empty dispatch group.
functions update the number of blocks running within a group.
function waits until all blocks associated with the
have completed, or until the specified
becomes empty within the specified amount of time, the function will return zero
indicating success. Otherwise, a non-zero return code will be returned.
is passed as the
calls to this function will wait an unlimited amount of time until the group
becomes empty and the return value is always zero.
function provides asynchronous notification of the completion of the blocks
associated with the
by submitting the
to the specified
once all blocks associated with the
The system holds a reference to the dispatch group while an asynchronous
notification is pending, therefore it is valid to release the
after setting a notification block.
The group will be empty at the time the notification block is submitted to the
target queue. The group may either be released with
or reused for additional operations.
convenience function behaves like so:
dispatch_group_async(dispatch_group_t group, dispatch_queue_t queue, dispatch_block_t block)