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

Re: How to kill a thread?


  • Subject: Re: How to kill a thread?
  • From: Brent Gulanowski <email@hidden>
  • Date: Sun, 19 Jan 2003 15:47:32 -0500

On Sunday, January 19, 2003, at 12:07 PM, Tackel wrote:

> 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:
>

I think it's best if the thread stops itself, no? You could run a check
on a flag every second or so, and if the flag is tripped, then the
thread should self-terminate. I've never done this, but it seems better
to me. A cheap way to do it might be to just set a lock on the object
which holds the data, or holds access to the data. You can lock the
object from outside, and interpret this inside the thread as an abort
command. Just an idea.

Brent Gulanowski
--
Mac game development news and discussion
http://www.idevgames.com
_______________________________________________
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.

References: 
 >How to kill a thread? (From: Tackel <email@hidden>)

  • Prev by Date: Re: How to kill a thread?
  • Next by Date: Re: Is a file used by another application?
  • Previous by thread: Re: How to kill a thread?
  • Next by thread: Re: How to kill a thread?
  • Index(es):
    • Date
    • Thread