Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Context for dispatch source handler

In Grand Central Dispatch, dispatch_source_set_event_handler_f has the signature

void
dispatch_source_set_event_handler_f(dispatch_source_t source, void (*function)(void *));

dispatch_source_set_cancel_handler_f has a similar signature.

What provides the argument for function? The man page doesn’t appear to list a function that sets the context.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

A dispatch source is a kind of dispatch object, so you can set the context using dispatch_set_context.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading