Submits a block object for execution and returns after that block finishes executing.
- iOS 4.0+
- macOS 10.6+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
The queue on which to submit the block. This parameter cannot be
The block containing the work to perform. This block has no return value and no parameters. This parameter cannot be
Submits a block to the specified dispatch queue for synchronous execution. Unlike
dispatch, this function does not return until the block has finished. Calling this function and targeting the current queue results in deadlock.
dispatch, no retain is performed on the target queue. Because calls to this function are synchronous, it "borrows" the reference of the caller. Moreover, no
Block is performed on the block.
As a performance optimization, this function executes blocks on the current thread whenever possible, with one obvious exception. Specifically, blocks submitted to the main dispatch queue always run on the main thread.