question for CFRunLoopStop()
question for CFRunLoopStop()
- Subject: question for CFRunLoopStop()
- From: "Philip Lukidis" <email@hidden>
- Date: Fri, 5 May 2006 11:46:53 -0400
- Thread-topic: question for CFRunLoopStop()
Hello. I hope that I'm posting this to the correct list.
Concerning CF, I was wondering if the following scenario is correct:
A "parent" thread creates a child thread via the pthread library. The child thread has only 1 runloop source on it (a timer in fact), and once the timer is applied onto the child runloop by the child itself, the child proceeds to call CFRunLoopRun() on itself. Now the parent is responsible for running down this child on demand. Can the parent rundown the child by:
-invalidating the timer (via CFRunLoopTimerInvalidate())
-removing the timer (via CFRunLoopRemoveTimer())
-calling CFRunLoopIsWaiting() in a while loop until it returns true (which indicates that all callbacks have drained and that it is waiting again, but of course since the timer was invalidated it can never be called again). Of course I should NOT holding a resource which the callback might need in order to execute and exit.
-calling CFRunLoopStop()
-calling pthread_join() on the pthread
Can this also be extended to other runloop sources, by using CFRunLoopSourceInvalidate() instead of CFRunLoopTimerInvalidate(), and CFRunLoopRemoveSource() instead of CFRunLoopRemoveTimer()?
If these procedures are incorrect, why so, and what are the alternatives?
thanks,
Philip Lukidis
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden