Killing a stuck NSThread
Killing a stuck NSThread
- Subject: Killing a stuck NSThread
- From: Dustin Wenz <email@hidden>
- Date: Wed, 26 Apr 2006 13:56:37 -0500
I have an application that spawns an NSThread to perform a blocking
network operation. Sometimes the operation takes too long to execute
and needs to be cancelled or killed by the main thread.
There was a discussion earlier this month about doing something
similar to this with NSThreads. The solution then was to send a
signal to the thread to have it terminate gracefully. Unfortunately,
since my thread is busy waiting for something, it has no way of
receiving such a signal.
I've tried obtaining a pthread id from the NSThread and doing a
pthread_kill() on it. For some reason though, calling pthread_self()
in the child thread actually gets the id for the main thread, so I
have no way to find the id for the child in order to kill it. Are
there any other solutions for this?
- .Dustin
_______________________________________________
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