Re: External kill of an NSThread?
Re: External kill of an NSThread?
- Subject: Re: External kill of an NSThread?
- From: "Philip Q" <email@hidden>
- Date: Tue, 21 Nov 2006 15:31:16 +1300
On 21/11/06, Roland Torres <email@hidden> wrote:
How does one kill an NSThread from another thread? As I read the
documentation, it seems possible only from within the thread, by
calling MPExit(). If I have a thread that hangs, I'd like to kill it
from another thread, but I don't see an API to do this. NSThread
doesn't return a thread id or descriptor, so how does one manage them?
Simply: you can't with NSThreads.
A thread will end when it's starting function returns (or something
like MPExit()), and this is a good thing.
Take a read of:
<http://www.cocoadev.com/index.pl?HowToKillAFrozenThread>
for a good discussion on why you can't do it, specifically: "It's
mutually assured destruction: kill it and die yourself."
-Phil
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden