• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Terminating a blocked NSThread from outside
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Terminating a blocked NSThread from outside
      • From: Andy <email@hidden>
References: 
 >Terminating a blocked NSThread from outside (From: Julian Barkway <email@hidden>)

  • Prev by Date: Re: What is NSRuleBook and why to I get exceptions ?
  • Next by Date: NSTextView and First Responder
  • Previous by thread: Terminating a blocked NSThread from outside
  • Next by thread: Re: Terminating a blocked NSThread from outside
  • Index(es):
    • Date
    • Thread