• 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: interrupting a thread/run loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: interrupting a thread/run loop


  • Subject: Re: interrupting a thread/run loop
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Fri, 1 Aug 2008 15:00:12 +0200


Le 1 août 08 à 14:52, Ken Thomases a écrit :

On Aug 1, 2008, at 6:43 AM, Chris Idou wrote:

I have a Cocoa thread waiting on events in a run loop. But I want to be able to give the waiting thread a "kick" to make it wake up and re-load its context.

I realise I could write my own custom run loop input source, but it seems like overkill if I could install a simple run loop observer and somehow just wake it up when I want it to re-initialize. Is there a way to do that?

You don't have to write a custom run-loop source. Just add an NSPort instance as a source and message it for the "kick".


Cheers,
Ken

Yes, and on 10.5, you can also use the method - [NSObject performSelector:onThread:withObject:waitUntilDone:], that will wake up the target thread runloop.



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >interrupting a thread/run loop (From: Chris Idou <email@hidden>)
 >Re: interrupting a thread/run loop (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: interrupting a thread/run loop
  • Next by Date: Re: compiler warning for not fully implementing protocol
  • Previous by thread: Re: interrupting a thread/run loop
  • Next by thread: Searchkit: adding metadata
  • Index(es):
    • Date
    • Thread