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

Comparing libev/ev.pod (file contents):
Revision 1.274 by root, Tue Nov 24 14:54:17 2009 UTC vs.
Revision 1.276 by root, Tue Dec 29 13:11:00 2009 UTC

792 792
793Ref/unref can be used to add or remove a reference count on the event 793Ref/unref can be used to add or remove a reference count on the event
794loop: Every watcher keeps one reference, and as long as the reference 794loop: Every watcher keeps one reference, and as long as the reference
795count is nonzero, C<ev_loop> will not return on its own. 795count is nonzero, C<ev_loop> will not return on its own.
796 796
797If you have a watcher you never unregister that should not keep C<ev_loop> 797This is useful when you have a watcher that you never intend to
798from returning, call ev_unref() after starting, and ev_ref() before 798unregister, but that nevertheless should not keep C<ev_loop> from
799returning. In such a case, call C<ev_unref> after starting, and C<ev_ref>
799stopping it. 800before stopping it.
800 801
801As an example, libev itself uses this for its internal signal pipe: It 802As an example, libev itself uses this for its internal signal pipe: It
802is not visible to the libev user and should not keep C<ev_loop> from 803is not visible to the libev user and should not keep C<ev_loop> from
803exiting if no event watchers registered by it are active. It is also an 804exiting if no event watchers registered by it are active. It is also an
804excellent way to do this for generic recurring timers or from within 805excellent way to do this for generic recurring timers or from within
1854C<repeat> value), or reset the running timer to the C<repeat> value. 1855C<repeat> value), or reset the running timer to the C<repeat> value.
1855 1856
1856This sounds a bit complicated, see L<Be smart about timeouts>, above, for a 1857This sounds a bit complicated, see L<Be smart about timeouts>, above, for a
1857usage example. 1858usage example.
1858 1859
1859=item ev_timer_remaining (loop, ev_timer *) 1860=item ev_tstamp ev_timer_remaining (loop, ev_timer *)
1860 1861
1861Returns the remaining time until a timer fires. If the timer is active, 1862Returns the remaining time until a timer fires. If the timer is active,
1862then this time is relative to the current event loop time, otherwise it's 1863then this time is relative to the current event loop time, otherwise it's
1863the timeout value currently configured. 1864the timeout value currently configured.
1864 1865

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines