• 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
Re: How to make a RunLoop patiently do nothing?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make a RunLoop patiently do nothing?


  • Subject: Re: How to make a RunLoop patiently do nothing?
  • From: "Sean McBride" <email@hidden>
  • Date: Wed, 3 Dec 2008 23:11:53 -0500

Chris Idou (email@hidden) on 2008-12-03 11:00 PM said:

>> how will you eventually make it shut down even if you do
>> do that, or will it just hang out there until the application
>> terminates?
>
>Good question. I had assumed that something like
>[myThread performSelector:@selector(exit) onThread:myThread ...
>
>would do the trick. Would this be a "nice" way to do it?

Well, the docs for exit say "Invoking this method should be avoided as
it does not give your thread a chance to clean up any resources it
allocated during its execution".

You said you wanted your thread to 'patiently wait for
performSelector:onThread: calls'?  When do you want it to stop waiting?
If at app quit time, then just leave it around.  If earlier, then just
send it a message to clean itself up (dealloc memory, etc.) and
invalidate the timer.  Then you are back to having no runloop sources
and voila.

Sean


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to make a RunLoop patiently do nothing?
      • From: "Michael Ash" <email@hidden>
References: 
 >Re: How to make a RunLoop patiently do nothing? (From: Roland King <email@hidden>)
 >Re: How to make a RunLoop patiently do nothing? (From: Chris Idou <email@hidden>)

  • Prev by Date: How to display simple dialog at application startup?
  • Next by Date: Re: Big picture relationships between NSConnection, NSInputStream, NSOutputStream etc
  • Previous by thread: Re: How to make a RunLoop patiently do nothing?
  • Next by thread: Re: How to make a RunLoop patiently do nothing?
  • Index(es):
    • Date
    • Thread