Re: How to kill a thread?
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.