在 Grand Central Dispatch 中,
dispatch_source_set_event_handler_f
有签名
void
dispatch_source_set_event_handler_f(dispatch_source_t source, void (*function)(void *));
dispatch_source_set_cancel_handler_f
有类似的签名。
什么为
function
提供了论据? 手册页似乎没有列出设置上下文的函数。
调度源是一种调度对象,因此您可以使用
dispatch_set_context
设置上下文。