Re: unable to break out of runloop because timers are fired and then the loop waits

2008-09-24 Thread Muraviev Dmitry
This works fine: NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; mTimer = [[NSTimer alloc] initWithFireDate: ... interval: ... target:self selector:@selector(...:) userInfo:nil repeats:YES]; [[NSRunLoop currentRunLoop] addTimer:mAudioIdleTimer forMode:NSDefaultRunLoopMode]; [[NS

Re: unable to break out of runloop because timers are fired and then the loop waits

2008-09-24 Thread Jason Coco
On Sep 24, 2008, at 15:15 , Jason Bobier wrote: Hey folks, I have a runloop on a thread that looks like this: while (! _cancelled) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [runloop runMode:NSDefaultRunLoopMode befor

Re: unable to break out of runloop because timers are fired and then the loop waits

2008-09-24 Thread Dave Dribin
On Sep 24, 2008, at 3:35 PM, Jason Bobier wrote: Thanks Nick. I'm trying to avoid polling tho (since that is the whole point of runloops and mach ports). Take a look a message I posted a few days ago that uses a Mach port to wake up the run loop:

Re: unable to break out of runloop because timers are fired and then the loop waits

2008-09-24 Thread Jason Bobier
Thanks Nick. I'm trying to avoid polling tho (since that is the whole point of runloops and mach ports). Jason On Sep 24, 2008, at 3:38 PM, Nick Zitzmann wrote: On Sep 24, 2008, at 1:15 PM, Jason Bobier wrote: Hey folks, I have a runloop on a thread that looks like this: while (! _cancel

Re: unable to break out of runloop because timers are fired and then the loop waits

2008-09-24 Thread Nick Zitzmann
On Sep 24, 2008, at 1:15 PM, Jason Bobier wrote: Hey folks, I have a runloop on a thread that looks like this: while (! _cancelled) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [runloop runMode:NSDefaultRunLoopMode befo

unable to break out of runloop because timers are fired and then the loop waits

2008-09-24 Thread Jason Bobier
Hey folks, I have a runloop on a thread that looks like this: while (! _cancelled) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [runloop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; [pool rel