[launchd-dev] libdispatch threads, blocked SIGINT and child process

Dave Keck davekeck at gmail.com
Fri Dec 3 02:47:36 PST 2010


> It turns out the man page of dispatch_queue_create() specifically lists the pthread_* calls which are compatible with GCD.
> pthread_sigmask() is one of them (the thread must be restored to its original state before returning though).

I thought I remembered seeing some docs on that topic, but couldn't
find them earlier. Thanks.

> It seems the other solution is to call pthread_sigmask() between my fork() and exec() to unblock the SIGINT signal.

Yep. I believe it's been mentioned on darwin-dev that posix_spawn is
now the recommended spawning API. (Though it has its shortcomings,
some of which can't be worked around and require fork/exec, such as
closing all file descriptors in the child. rdar://7724566 and
rdar://8390960)


More information about the launchd-dev mailing list