Re: Terminating a blocked NSThread from outside
Re: Terminating a blocked NSThread from outside
- Subject: Re: Terminating a blocked NSThread from outside
- From: Cryx <email@hidden>
- Date: Tue, 23 Apr 2002 21:56:54 -0500
I suppose you could make the socket an instance var and just close the
file descriptor from another thread. That should cause the system call
in the subthread to return an error.
On Tuesday, April 23, 2002, at 02:49 PM, Julian Barkway wrote:
Today's question: ;-)
I have an NSThread which is blocked waiting on a BSD Socket and I would
obviously like to give the user some way out of the block. Since the
thread is, presumably, sitting in a tight loop somewhere deep in the
depths of the kernel, synchronous thread I/O is out of the question. Is
there a way of sending the thread a SIGINT or a SIGTERM to give it a
kick up the backside, so to speak? (Unfortunately, for various reasons,
asynch access to the socket is not possible).
I've checked the NSThread docs but it appears there's no way, using the
Cocoa API, to do this except from within the thread itself. [NSThread
exit] just kills the current thread - in my case the main task!
Obviously, this is not desirable behaviour.
I guess I'm hoping somebody has a clever hack up their sleeve....
Thanks for any help!
Cheers,
Julian.
_______________________________________________
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.
_______________________________________________
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.