Returns the queue on which the currently executing block is running.


func dispatch_get_current_queue() -> DispatchQueue

Return Value

Returns the current queue.


This function is defined to never return NULL.

When called from outside of the context of a submitted block, this function returns the main queue if the call is executed from the main thread. If the call is made from any other thread, this function returns the default concurrent queue.

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