• 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: [iPhone] how do I stop a running thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [iPhone] how do I stop a running thread


  • Subject: Re: [iPhone] how do I stop a running thread
  • From: Michael Davey <email@hidden>
  • Date: Sun, 3 Jan 2010 17:28:15 +1100

To elaborate and agree...

Run your thread in a loop such as:

while (isRunning) {
	// work done here
}

and have a method such as:

-(void)stopThread {
	isRunning = NO;
}

On 3 Jan 2010, at 16:56, Glenn L. Austin wrote:

> Your best bet -- have a flag that the thread can check for exiting.
>
> Terminating a thread from outside the thread could leave resources locked and unavailable.
>
> On Jan 2, 2010, at 9:49 PM, Tharindu Madushanka wrote:
>
>> I am creating a thread with method detachNewThreadSelector:
>>
>> How could I stop the thread while it is running ?
>
> --
> Glenn L. Austin, Computer Wizard and Race Car Driver         <><
> <http://www.austin-soft.com>
>
>
>
> _______________________________________________
>
> 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

_______________________________________________

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: [iPhone] how do I stop a running thread
      • From: Tharindu Madushanka <email@hidden>
References: 
 >[iPhone] how do I stop a running thread (From: Tharindu Madushanka <email@hidden>)
 >Re: [iPhone] how do I stop a running thread (From: "Glenn L. Austin" <email@hidden>)

  • Prev by Date: Re: Table views in combined tab/nav interface
  • Next by Date: Re: [iPhone] how do I stop a running thread
  • Previous by thread: Re: [iPhone] how do I stop a running thread
  • Next by thread: Re: [iPhone] how do I stop a running thread
  • Index(es):
    • Date
    • Thread