• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
question for CFRunLoopStop()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: question for CFRunLoopStop()
      • From: Kevin Van Vechten <email@hidden>
  • Prev by Date: Relocation overflow ... displacement too large
  • Next by Date: Re: question for CFRunLoopStop()
  • Previous by thread: Relocation overflow ... displacement too large
  • Next by thread: Re: question for CFRunLoopStop()
  • Index(es):
    • Date
    • Thread