Submits a barrier function for asynchronous execution and returns immediately.
- iOS 4.3+
- macOS 10.7+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
The dispatch queue on which to execute the barrier function. The queue is retained by the system until the function has run to completion. This parameter cannot be
The application-defined context parameter to pass to the function.
The application-defined barrier function to be executed. The first parameter passed to this function is the value of the
contextparameter. This parameter cannot be
Calls to this function always return immediately after the barrier function has been submitted and never wait for that function to be invoked. When the barrier function reaches the front of a private concurrent queue, it is not executed immediately. Instead, the queue waits until its currently executing blocks finish executing. At that point, the queue executes the barrier function by itself. Any blocks submitted after the barrier function are not executed until the barrier function completes.
The queue you specify should be a concurrent queue that you create yourself using the
dispatch function. If the queue you pass to this function is a serial queue or one of the global concurrent queues, this function behaves like the