Le 15 sept. 2013 à 16:23, Gerriet M. Denkmann <gerr...@mdenkmann.de> a écrit :

> 
> On 15 Sep 2013, at 16:42, Jean-Daniel Dupas <devli...@shadowlab.org> wrote:
> 
>> XPC is based on GCD. There is chance that your request handling occurs in a 
>> GCD thread and not on the main thread.
> 
> Correct. NSThread tells me:
> mainThread            <NSThread: 0x7f92b14096a0>{name = (null), num = 1} 
> currentThread         <NSThread: 0x7f92b3502cf0>{name = (null), num = 2}
> 
> 
>> [NSRunLoop currentRunLoop] returns the current thread run loop. If you are 
>> not on the main thread, it will not work.
> 
> NSRunLoop *currentRunLoop = [ NSRunLoop currentRunLoop ];
> CFRunLoopRef rl1 = [ currentRunLoop getCFRunLoop ];           //      mode = 
> nil
> 
> CFRunLoopRef rl2 = CFRunLoopGetMain ();                               //      
> mode = kCFRunLoopDefaultMode
> 
> 
>> Try that instead: CFRunLoopStop(CFRunLoopGetMain());
> Tried it. Even tried stopping both run loops, but to no avail. The helper 
> tool just will not quit.
> 
> But maybe I will be able to make my NSTimers work now having a better 
> understanding of what is going on.
> 

Now that you mention it, I remember it is not possible to stop a [NSRunLoop 
run] call (at least not in a reliable way).

See the -[NSRunLoop run] documentation for an alternative way to do that, or 
just call exit() as others have suggested.

-- Jean-Daniel





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to