Skip navigation.
 
mlinterrupting a thread/run loop
FROM : Chris Idou
DATE : Fri Aug 01 13:43:48 2008

In the Java thread API (which I am most familiar with) you put the thread in a wait() and then another thread can send the thread an interrupt() which makes it wake up and do stuff.

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?

Related mailsAuthorDate
mlinterrupting a thread/run loop Chris Idou Aug 1, 13:43
mlRe: interrupting a thread/run loop Ken Thomases Aug 1, 14:52
mlRe: interrupting a thread/run loop Jean-Daniel Dupas Aug 1, 15:00