What's the purpose of CFRunLoopScheduleCallBack function in CFRunLoopSource?

180 views Asked by At

I'm trying to define custom input source for CFRunLoop, I've read the Threading Programming Guide document wrote by Apple and this problem is the only one that I cannot understand.

So, I want to know what is the purpose of CFRunLoopScheduleCallBack function or how to implement this function?

1

There are 1 answers

2
Jacek Lampart On

This callback is called when your source is added to the run loop. You can leave it empty if you don't need any custom code to run on this event.

You implement it like this:

void MyCallBack (void *info, CFRunLoopRef rl, CFStringRef mode) { // code }