-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
.\" ========================================================================
.\"
.IX Title "LIBEV 3"
-.TH LIBEV 3 "2013-12-27" "libev-4.15" "libev - high performance full featured event loop"
+.TH LIBEV 3 "2014-09-05" "libev-4.15" "libev - high performance full featured event loop"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
and \f(CW\*(C`ev_loop_destroy\*(C'\fR.
.IP "ev_loop_fork (loop)" 4
.IX Item "ev_loop_fork (loop)"
-This function sets a flag that causes subsequent \f(CW\*(C`ev_run\*(C'\fR iterations to
-reinitialise the kernel state for backends that have one. Despite the
-name, you can call it anytime, but it makes most sense after forking, in
-the child process. You \fImust\fR call it (or use \f(CW\*(C`EVFLAG_FORKCHECK\*(C'\fR) in the
-child before resuming or calling \f(CW\*(C`ev_run\*(C'\fR.
+This function sets a flag that causes subsequent \f(CW\*(C`ev_run\*(C'\fR iterations
+to reinitialise the kernel state for backends that have one. Despite
+the name, you can call it anytime you are allowed to start or stop
+watchers (except inside an \f(CW\*(C`ev_prepare\*(C'\fR callback), but it makes most
+sense after forking, in the child process. You \fImust\fR call it (or use
+\&\f(CW\*(C`EVFLAG_FORKCHECK\*(C'\fR) in the child before resuming or calling \f(CW\*(C`ev_run\*(C'\fR.
.Sp
Again, you \fIhave\fR to call it on \fIany\fR loop that you want to re-use after
a fork, \fIeven if you do not plan to use the loop in the parent\fR. This is
time. This is usually the right thing as this timestamp refers to the time
of the event triggering whatever timeout you are modifying/starting. If
you suspect event processing to be delayed and you \fIneed\fR to base the
-timeout on the current time, use something like this to adjust for this:
+timeout on the current time, use something like the following to adjust
+for it:
.PP
.Vb 1
-\& ev_timer_set (&timer, after + ev_now () \- ev_time (), 0.);
+\& ev_timer_set (&timer, after + (ev_time () \- ev_now ()), 0.);
.Ve
.PP
If the event loop is suspended for a long time, you can also force an
update of the time returned by \f(CW\*(C`ev_now ()\*(C'\fR by calling \f(CW\*(C`ev_now_update
-()\*(C'\fR.
+()\*(C'\fR, although that will push the event time of all outstanding events
+further into the future.
.PP
\fIThe special problem of unsynchronised clocks\fR
.IX Subsection "The special problem of unsynchronised clocks"
prepare watchers get invoked before the process blocks and check watchers
afterwards.
.PP
-You \fImust not\fR call \f(CW\*(C`ev_run\*(C'\fR or similar functions that enter
-the current event loop from either \f(CW\*(C`ev_prepare\*(C'\fR or \f(CW\*(C`ev_check\*(C'\fR
-watchers. Other loops than the current one are fine, however. The
-rationale behind this is that you do not need to check for recursion in
-those watchers, i.e. the sequence will always be \f(CW\*(C`ev_prepare\*(C'\fR, blocking,
-\&\f(CW\*(C`ev_check\*(C'\fR so if you have one watcher of each kind they will always be
-called in pairs bracketing the blocking call.
+You \fImust not\fR call \f(CW\*(C`ev_run\*(C'\fR (or similar functions that enter the
+current event loop) or \f(CW\*(C`ev_loop_fork\*(C'\fR from either \f(CW\*(C`ev_prepare\*(C'\fR or
+\&\f(CW\*(C`ev_check\*(C'\fR watchers. Other loops than the current one are fine,
+however. The rationale behind this is that you do not need to check
+for recursion in those watchers, i.e. the sequence will always be
+\&\f(CW\*(C`ev_prepare\*(C'\fR, blocking, \f(CW\*(C`ev_check\*(C'\fR so if you have one watcher of each
+kind they will always be called in pairs bracketing the blocking call.
.PP
Their main purpose is to integrate other event mechanisms into libev and
their use is somewhat advanced. They could be used, for example, to track
\& struct ev_loop *loop_hi = ev_default_init (0);
\& struct ev_loop *loop_lo = 0;
\& ev_embed embed;
-\&
+\&
\& // see if there is a chance of getting one that works
\& // (remember that a flags value of 0 means autodetection)
\& loop_lo = ev_embeddable_backends () & ev_recommended_backends ()
\& struct ev_loop *loop = ev_default_init (0);
\& struct ev_loop *loop_socket = 0;
\& ev_embed embed;
-\&
+\&
\& if (ev_supported_backends () & ~ev_recommended_backends () & EVBACKEND_KQUEUE)
\& if ((loop_socket = ev_loop_new (EVBACKEND_KQUEUE))
\& {
\fIThe special problem of life after fork \- how is it possible?\fR
.IX Subsection "The special problem of life after fork - how is it possible?"
.PP
-Most uses of \f(CW\*(C`fork()\*(C'\fR consist of forking, then some simple calls to set
+Most uses of \f(CW\*(C`fork ()\*(C'\fR consist of forking, then some simple calls to set
up/change the process environment, followed by a call to \f(CW\*(C`exec()\*(C'\fR. This
sequence should be handled by libev without any problems.
.PP
\& ...
\& }
\& }
-\&
+\&
\& myfunctor f;
\&
\& ev::io w;