ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.pod
(Generate patch)

Comparing libev/ev.pod (file contents):
Revision 1.384 by sf-exg, Sun Oct 16 11:02:57 2011 UTC vs.
Revision 1.386 by root, Mon Dec 19 20:15:28 2011 UTC

1020can be done relatively simply by putting mutex_lock/unlock calls around 1020can be done relatively simply by putting mutex_lock/unlock calls around
1021each call to a libev function. 1021each call to a libev function.
1022 1022
1023However, C<ev_run> can run an indefinite time, so it is not feasible 1023However, C<ev_run> can run an indefinite time, so it is not feasible
1024to wait for it to return. One way around this is to wake up the event 1024to wait for it to return. One way around this is to wake up the event
1025loop via C<ev_break> and C<av_async_send>, another way is to set these 1025loop via C<ev_break> and C<ev_async_send>, another way is to set these
1026I<release> and I<acquire> callbacks on the loop. 1026I<release> and I<acquire> callbacks on the loop.
1027 1027
1028When set, then C<release> will be called just before the thread is 1028When set, then C<release> will be called just before the thread is
1029suspended waiting for new events, and C<acquire> is called just 1029suspended waiting for new events, and C<acquire> is called just
1030afterwards. 1030afterwards.
1958 1958
1959If you ask a timer to call your callback after three seconds, then 1959If you ask a timer to call your callback after three seconds, then
1960you expect it to be invoked after three seconds - but of course, this 1960you expect it to be invoked after three seconds - but of course, this
1961cannot be guaranteed to infinite precision. Less obviously, it cannot be 1961cannot be guaranteed to infinite precision. Less obviously, it cannot be
1962guaranteed to any precision by libev - imagine somebody suspending the 1962guaranteed to any precision by libev - imagine somebody suspending the
1963process a STOP signal for a few hours for example. 1963process with a STOP signal for a few hours for example.
1964 1964
1965So, libev tries to invoke your callback as soon as possible I<after> the 1965So, libev tries to invoke your callback as soon as possible I<after> the
1966delay has occurred, but cannot guarantee this. 1966delay has occurred, but cannot guarantee this.
1967 1967
1968A less obvious failure mode is calling your callback too early: many event 1968A less obvious failure mode is calling your callback too early: many event
3473 ev_once (STDIN_FILENO, EV_READ, 10., stdin_ready, 0); 3473 ev_once (STDIN_FILENO, EV_READ, 10., stdin_ready, 0);
3474 3474
3475=item ev_feed_fd_event (loop, int fd, int revents) 3475=item ev_feed_fd_event (loop, int fd, int revents)
3476 3476
3477Feed an event on the given fd, as if a file descriptor backend detected 3477Feed an event on the given fd, as if a file descriptor backend detected
3478the given events it. 3478the given events.
3479 3479
3480=item ev_feed_signal_event (loop, int signum) 3480=item ev_feed_signal_event (loop, int signum)
3481 3481
3482Feed an event as if the given signal occurred. See also C<ev_feed_signal>, 3482Feed an event as if the given signal occurred. See also C<ev_feed_signal>,
3483which is async-safe. 3483which is async-safe.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines