Re: CFRunLoopRun() and processing posix signals
Re: CFRunLoopRun() and processing posix signals
- Subject: Re: CFRunLoopRun() and processing posix signals
- From: "A.M." <email@hidden>
- Date: Tue, 23 Nov 2010 14:54:42 -0500
On Nov 23, 2010, at 12:55 PM, Philippe Strauss wrote:
> Hello Cocoa developpers,
>
> When using a CFRunLoopRun() event loop in a non-GUI daemon, what kind of resource and handler do you need to add to the loop for beeing able to process signals (unix signals) and not beeing stuck in:
>
> (gdb) bt
> #0 0x00007fff815592da in mach_msg_trap ()
> #1 0x00007fff8155994d in mach_msg ()
> #2 0x00007fff83f87932 in __CFRunLoopRun ()
> #3 0x00007fff83f86dbf in CFRunLoopRunSpecific ()
> #4 0x00007fff83f86b46 in CFRunLoopRun ()
> #5 0x00000001000017af in main (argc=0, argv=0x7fff5fbfe418) at jackond.cpp:331
CFRunLoop does not normally process signals, however, it is possible to hack it in with CFFileDescriptor and kqueue. Look at Apple example code to accomplish this, specifically this function:
static void InstallHandleSIGTERMFromRunLoop(void)
http://developer.apple.com/library/mac/#samplecode/PreLoginAgents/Listings/PreLoginAgentCarbon_main_c.html#//apple_ref/doc/uid/DTS10004414-PreLoginAgentCarbon_main_c-DontLinkElementID_3
Cheers,
M_______________________________________________
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