Sets the target queue for the given object.
- iOS 4.0+
- macOS 10.6+
- tvOS 9.0+
- watchOS 2.0+
The object to modify. This parameter cannot be
The new target queue for the object. The queue is retained, and the previous one, if any, is released. This parameter cannot be
An object's target queue is responsible for processing the object. The target queue determines the queue on which the object's finalizer is invoked. In addition, modifying the target queue of some objects changes their behavior:
A dispatch queue's priority is inherited from its target queue. Use the
dispatch_get_global_queue(_:function to obtain a suitable target queue of the desired priority.
If you submit a block to a serial queue, and the serial queue’s target queue is a different serial queue, that block is not invoked concurrently with blocks submitted to the target queue or to any other queue with that same target queue.
A dispatch source's target queue specifies where its event handler and cancellation handler blocks are submitted.
Dispatch I/O channels:
A dispatch I/O channel's target queue specifies where its I/O operations are executed. This may affect the priority of the resulting I/O operations. For example, if the channel's target queue's priority is set to
DISPATCH_QUEUE_PRIORITY_BACKGROUND, then any I/O operations performed by
length: queue: io Handler:)
write(offset:on that queue are throttled when there is I/O contention.
data: queue: io Handler:)