While you can simply pass 0
/ NULL
for the context argument, dispatch_async_f()
takes void (*)(void*)
as a parameter to the function, you cannot pass it a function that takes no arguments.
You need to either change your function to accept the void*
parameter:
void func(void*) {}
... or, if you cannot, wrap it:
void orig(void) {} void wrapper(void*) { orig(); }
source share