Function

dispatch_block_perform

Creates, synchronously executes, and releases a dispatch block from the specified block and flags.

Declaration

void dispatch_block_perform(dispatch_block_flags_t flags, dispatch_block_t block);

Parameters

flags

Configuration flags for the block object. For possible values, see dispatch_block_flags_t.

Passing a value that is not a bitwise OR of valid flags results in NULL being returned.

block

The block to create the dispatch block from.

Discussion

This function is equivalent to the following code:

dispatch_block_t b = dispatch_block_create(flags, block);
b();
Block_release(b);

This functionality may be implemented more efficiently internally by not requiring a copy to the heap of the specified block or the allocation of a new block object.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software