• 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
How to kill a thread?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to kill a thread?


  • Subject: How to kill a thread?
  • From: Tackel <email@hidden>
  • Date: Sun, 19 Jan 2003 18:07:43 +0100

Hi,

I don't know how to stop a thread, any idea?
I have a search process running in a separate thread and want to let the
user to stop it. Here is an example of the code:


-(void)search{
id p=[NSAutoreleasePool new];

search_process

[p release];
searching= FALSE;
}


- (IBAction)start:(id)sender
{

if (!searching) {
searching =TRUE;
[startbutton setTitle : @"stop"];

id p=[NSAutoreleasePool new];
[NSThread detachNewThreadSelector:@selector(search) toTarget:self
withObject:nil];

[p release];
}
else
how to stop the search process???

}


Thanks,
Tackel.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: How to kill a thread?
      • From: Brent Gulanowski <email@hidden>
    • Re: How to kill a thread?
      • From: Shaun Wexler <email@hidden>
    • Re: How to kill a thread?
      • From: Nicholas Riley <email@hidden>
  • Prev by Date: Memory management questions using UUID example
  • Next by Date: Re: Memory management questions using UUID example
  • Previous by thread: Color differences between images in Cocoa and Carbon?
  • Next by thread: Re: How to kill a thread?
  • Index(es):
    • Date
    • Thread