• 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: Killing a Thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Killing a Thread


  • Subject: Re: Killing a Thread
  • From: Joseph Kelly <email@hidden>
  • Date: Tue, 25 Nov 2008 09:20:20 -0800


On Nov 25, 2008, at 1:17 AM, Mahaboob wrote:

On 11/25/08 2:33 PM, "Mahaboob" <email@hidden> wrote:




On 11/24/08 10:01 PM, "Joseph Kelly" <email@hidden> wrote:

Why can't your thread just return when it's finished?

I'm new to thread programming. I need to kill the thread in a void function.
Here I'm attaching the file. Is it I'm going right way?

I looked at your code, and you really have no need to explicitly kill the thread. When you set your m_isBackgroundThreadToTerminate to YES and tell the run loop to stop, it should just exit. If it's crashing, I think it's probably due to some other kind of issues (in which case you will find this link to be quite valuable: http://developer.apple.com/technotes/tn2004/tn2124.html) .


If you are developing for 10.5 only, I would strongly recommend using NSOperation, which effectively hides some of the details of threading and concurrency.

 Joe K.
_______________________________________________

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: Killing a Thread
      • From: Mahaboob <email@hidden>
References: 
 >Re: Killing a Thread (From: Mahaboob <email@hidden>)

  • Prev by Date: Re: NSDate's descriptionwithLocale method output
  • Next by Date: awakeFromNib is not called in Tiger [PPC], but called in Leopard [Intel]
  • Previous by thread: Re: Killing a Thread
  • Next by thread: Re: Killing a Thread
  • Index(es):
    • Date
    • Thread