Terminating a blocked NSThread from outside
Terminating a blocked NSThread from outside
- Subject: Terminating a blocked NSThread from outside
- From: Julian Barkway <email@hidden>
- Date: Tue, 23 Apr 2002 21:49:12 +0200
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.