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.

See Also

Managing Dispatch Queues

class DispatchQueue

DispatchQueue manages the execution of work items. Each work item submitted to a queue is processed on a pool of threads managed by the system.

class DispatchSpecificKey

DispatchSpecificKey is a class that encapsulates keys that can be associated with a contextual value on a DispatchQueue using the setSpecific<T>(key:value:) method, and accessed using the getSpecific<T>(key:) method.

func setTarget(queue: DispatchQueue?)

Sets the target queue for the given object.

func dispatchMain() -> Never

Executes blocks submitted to the main queue.