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

Comparing libev/ev.pod (file contents):
Revision 1.393 by root, Sat Jan 21 12:23:45 2012 UTC vs.
Revision 1.397 by root, Mon Feb 13 01:52:14 2012 UTC

2108keep up with the timer (because it takes longer than those 10 seconds to 2108keep up with the timer (because it takes longer than those 10 seconds to
2109do stuff) the timer will not fire more than once per event loop iteration. 2109do stuff) the timer will not fire more than once per event loop iteration.
2110 2110
2111=item ev_timer_again (loop, ev_timer *) 2111=item ev_timer_again (loop, ev_timer *)
2112 2112
2113This will act as if the timer timed out and restarts it again if it is 2113This will act as if the timer timed out, and restarts it again if it is
2114repeating. The exact semantics are: 2114repeating. It basically works like calling C<ev_timer_stop>, updating the
2115timeout to the C<repeat> value and calling C<ev_timer_start>.
2115 2116
2117The exact semantics are as in the following rules, all of which will be
2118applied to the watcher:
2119
2120=over 4
2121
2116If the timer is pending, its pending status is cleared. 2122=item If the timer is pending, the pending status is always cleared.
2117 2123
2118If the timer is started but non-repeating, stop it (as if it timed out). 2124=item If the timer is started but non-repeating, stop it (as if it timed
2125out, without invoking it).
2119 2126
2120If the timer is repeating, either start it if necessary (with the 2127=item If the timer is repeating, make the C<repeat> value the new timeout
2121C<repeat> value), or reset the running timer to the C<repeat> value. 2128and start the timer, if necessary.
2129
2130=back
2122 2131
2123This sounds a bit complicated, see L<Be smart about timeouts>, above, for a 2132This sounds a bit complicated, see L<Be smart about timeouts>, above, for a
2124usage example. 2133usage example.
2125 2134
2126=item ev_tstamp ev_timer_remaining (loop, ev_timer *) 2135=item ev_tstamp ev_timer_remaining (loop, ev_timer *)
3908with C<operator ()> can be used as callbacks. Other types should be easy 3917with C<operator ()> can be used as callbacks. Other types should be easy
3909to add as long as they only need one additional pointer for context. If 3918to add as long as they only need one additional pointer for context. If
3910you need support for other types of functors please contact the author 3919you need support for other types of functors please contact the author
3911(preferably after implementing it). 3920(preferably after implementing it).
3912 3921
3922For all this to work, your C++ compiler either has to use the same calling
3923conventions as your C compiler (for static member functions), or you have
3924to embed libev and compile libev itself as C++.
3925
3913Here is a list of things available in the C<ev> namespace: 3926Here is a list of things available in the C<ev> namespace:
3914 3927
3915=over 4 3928=over 4
3916 3929
3917=item C<ev::READ>, C<ev::WRITE> etc. 3930=item C<ev::READ>, C<ev::WRITE> etc.
4495If defined to be C<1>, libev will compile in support for the Linux inotify 4508If defined to be C<1>, libev will compile in support for the Linux inotify
4496interface to speed up C<ev_stat> watchers. Its actual availability will 4509interface to speed up C<ev_stat> watchers. Its actual availability will
4497be detected at runtime. If undefined, it will be enabled if the headers 4510be detected at runtime. If undefined, it will be enabled if the headers
4498indicate GNU/Linux + Glibc 2.4 or newer, otherwise disabled. 4511indicate GNU/Linux + Glibc 2.4 or newer, otherwise disabled.
4499 4512
4513=item EV_NO_SMP
4514
4515If defined to be C<1>, libev will assume that memory is always coherent
4516between threads, that is, threads can be used, but threads never run on
4517different cpus (or different cpu cores). This reduces dependencies
4518and makes libev faster.
4519
4520=item EV_NO_THREADS
4521
4522If defined to be C<1>, libev will assume that it will never be called
4523from different threads, which is a stronger assumption than C<EV_NO_SMP>,
4524above. This reduces dependencies and makes libev faster.
4525
4500=item EV_ATOMIC_T 4526=item EV_ATOMIC_T
4501 4527
4502Libev requires an integer type (suitable for storing C<0> or C<1>) whose 4528Libev requires an integer type (suitable for storing C<0> or C<1>) whose
4503access is atomic and serialised with respect to other threads or signal 4529access is atomic and serialised with respect to other threads or signal
4504contexts. No such type is easily found in the C language, so you can 4530contexts. No such type is easily found in the C language, so you can

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines