--- libev/ev.pod 2009/07/15 16:58:53 1.258 +++ libev/ev.pod 2009/07/19 01:36:34 1.259 @@ -2078,22 +2078,28 @@ will try it's best to deliver signals synchronously, i.e. as part of the normal event processing, like any other event. +Note that only the default loop supports registering signal watchers +currently. + If you want signals asynchronously, just use C as you would do without libev and forget about sharing the signal. You can even use C from a signal handler to synchronously wake up an event loop. You can configure as many watchers as you like per signal. Only when the -first watcher gets started will libev actually register a signal handler -with the kernel (thus it coexists with your own signal handlers as long as -you don't register any with libev for the same signal). Similarly, when -the last signal watcher for a signal is stopped, libev will reset the -signal handler to SIG_DFL (regardless of what it was set to before). +first watcher gets started will libev actually register something with +the kernel (thus it coexists with your own signal handlers as long as you +don't register any with libev for the same signal). + +Both the signal mask state (C) and the signal handler state +(C) are unspecified after starting a signal watcher (and after +sotpping it again), that is, libev might or might not block the signal, +and might or might not set or restore the installed signal handler. If possible and supported, libev will install its handlers with -C behaviour enabled, so system calls should not be unduly -interrupted. If you have a problem with system calls getting interrupted by -signals you can block all signals in an C watcher and unblock -them in an C watcher. +C (or equivalent) behaviour enabled, so system calls should +not be unduly interrupted. If you have a problem with system calls getting +interrupted by signals you can block all signals in an C watcher +and unblock them in an C watcher. =head3 Watcher-Specific Functions and Data Members @@ -2148,8 +2154,8 @@ =head3 Process Interaction Libev grabs C as soon as the default event loop is -initialised. This is necessary to guarantee proper behaviour even if -the first child watcher is started after the child exits. The occurrence +initialised. This is necessary to guarantee proper behaviour even if the +first child watcher is started after the child exits. The occurrence of C is recorded asynchronously, but child reaping is done synchronously as part of the event loop processing. Libev always reaps all children, even ones not watched. @@ -2169,7 +2175,8 @@ Currently, the child watcher never gets stopped, even when the child terminates, so normally one needs to stop the watcher in the callback. Future versions of libev might stop the watcher automatically -when a child exit is detected. +when a child exit is detected (calling C twice is not a +problem). =head3 Watcher-Specific Functions and Data Members