Gets the value for the key associated with the specified dispatch queue.


void * dispatch_queue_get_specific(dispatch_queue_t queue, const void *key);



The queue containing the desired context data. This parameter must not be NULL.


The key that identifies the associated context data. Keys are only compared as pointers and are never dereferenced. Thus, you can use a pointer to a static variable for a specific subsystem or any other value that allows you to identify the value uniquely. Specifying a pointer to a string constant is not recommended.

Return Value

The context data associated with key or NULL if no context was found.


You can use this method to get the context data associated with a specific dispatch queue. Blocks executing on a queue can use the dispatch_get_specific function to retrieve the context associated with that specific queue instead.

See Also

Getting and Setting Contextual Data


Returns the value for the key associated with the current dispatch queue.


Sets the key/value data for the specified dispatch 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