summaryrefslogtreecommitdiff
path: root/ev.pod
diff options
context:
space:
mode:
authorroot <root>2009-07-19 01:36:34 +0000
committerroot <root>2009-07-19 01:36:34 +0000
commitdfa24c077cc325f0e21e169379aa6cac343cdaa2 (patch)
tree6678a0f6a8036a1467ab0c9d7dee48d47afdb910 /ev.pod
parentc86e19d112a50d0f32e74f6f698f6dc81687da74 (diff)
*** empty log message ***
Diffstat (limited to 'ev.pod')
-rw-r--r--ev.pod31
1 files changed, 19 insertions, 12 deletions
diff --git a/ev.pod b/ev.pod
index 289362b..194b439 100644
--- a/ev.pod
+++ b/ev.pod
@@ -2078,22 +2078,28 @@ signal one or more times. Even though signals are very asynchronous, libev
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<sigaction> as you would
do without libev and forget about sharing the signal. You can even use
C<ev_async> 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<sigprocmask>) and the signal handler state
+(C<sigaction>) 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<SA_RESTART> 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<ev_check> watcher and unblock
-them in an C<ev_prepare> watcher.
+C<SA_RESTART> (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<ev_check> watcher
+and unblock them in an C<ev_prepare> watcher.
=head3 Watcher-Specific Functions and Data Members
@@ -2148,8 +2154,8 @@ libev)
=head3 Process Interaction
Libev grabs C<SIGCHLD> 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<SIGCHLD> 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 @@ that, so other libev users can use C<ev_child> watchers freely.
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<ev_child_stop> twice is not a
+problem).
=head3 Watcher-Specific Functions and Data Members