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

Comparing libev/ev.pod (file contents):
Revision 1.194 by root, Mon Oct 20 16:08:36 2008 UTC vs.
Revision 1.197 by root, Tue Oct 21 20:52:30 2008 UTC

894=item C<EV_ERROR> 894=item C<EV_ERROR>
895 895
896An unspecified error has occurred, the watcher has been stopped. This might 896An unspecified error has occurred, the watcher has been stopped. This might
897happen because the watcher could not be properly started because libev 897happen because the watcher could not be properly started because libev
898ran out of memory, a file descriptor was found to be closed or any other 898ran out of memory, a file descriptor was found to be closed or any other
899problem. Libev considers these application bugs.
900
899problem. You best act on it by reporting the problem and somehow coping 901You best act on it by reporting the problem and somehow coping with the
900with the watcher being stopped. 902watcher being stopped. Note that well-written programs should not receive
903an error ever, so when your watcher receives it, this usually indicates a
904bug in your program.
901 905
902Libev will usually signal a few "dummy" events together with an error, for 906Libev will usually signal a few "dummy" events together with an error, for
903example it might indicate that a fd is readable or writable, and if your 907example it might indicate that a fd is readable or writable, and if your
904callbacks is well-written it can just attempt the operation and cope with 908callbacks is well-written it can just attempt the operation and cope with
905the error from read() or write(). This will not work in multi-threaded 909the error from read() or write(). This will not work in multi-threaded
969 973
970 ev_io_start (EV_DEFAULT_UC, &w); 974 ev_io_start (EV_DEFAULT_UC, &w);
971 975
972=item C<ev_TYPE_stop> (loop *, ev_TYPE *watcher) 976=item C<ev_TYPE_stop> (loop *, ev_TYPE *watcher)
973 977
974Stops the given watcher again (if active) and clears the pending 978Stops the given watcher if active, and clears the pending status (whether
979the watcher was active or not).
980
975status. It is possible that stopped watchers are pending (for example, 981It is possible that stopped watchers are pending - for example,
976non-repeating timers are being stopped when they become pending), but 982non-repeating timers are being stopped when they become pending - but
977C<ev_TYPE_stop> ensures that the watcher is neither active nor pending. If 983calling C<ev_TYPE_stop> ensures that the watcher is neither active nor
978you want to free or reuse the memory used by the watcher it is therefore a 984pending. If you want to free or reuse the memory used by the watcher it is
979good idea to always call its C<ev_TYPE_stop> function. 985therefore a good idea to always call its C<ev_TYPE_stop> function.
980 986
981=item bool ev_is_active (ev_TYPE *watcher) 987=item bool ev_is_active (ev_TYPE *watcher)
982 988
983Returns a true value iff the watcher is active (i.e. it has been started 989Returns a true value iff the watcher is active (i.e. it has been started
984and not yet been stopped). As long as a watcher is active you must not modify 990and not yet been stopped). As long as a watcher is active you must not modify
1794to exchange stat structures with application programs compiled using the 1800to exchange stat structures with application programs compiled using the
1795default compilation environment. 1801default compilation environment.
1796 1802
1797=head3 Inotify and Kqueue 1803=head3 Inotify and Kqueue
1798 1804
1799When C<inotify (7)> support has been compiled into libev (generally only 1805When C<inotify (7)> support has been compiled into libev (generally
1806only available with Linux 2.6.25 or above due to bugs in earlier
1800available with Linux) and present at runtime, it will be used to speed up 1807implementations) and present at runtime, it will be used to speed up
1801change detection where possible. The inotify descriptor will be created lazily 1808change detection where possible. The inotify descriptor will be created
1802when the first C<ev_stat> watcher is being started. 1809lazily when the first C<ev_stat> watcher is being started.
1803 1810
1804Inotify presence does not change the semantics of C<ev_stat> watchers 1811Inotify presence does not change the semantics of C<ev_stat> watchers
1805except that changes might be detected earlier, and in some cases, to avoid 1812except that changes might be detected earlier, and in some cases, to avoid
1806making regular C<stat> calls. Even in the presence of inotify support 1813making regular C<stat> calls. Even in the presence of inotify support
1807there are many cases where libev has to resort to regular C<stat> polling, 1814there are many cases where libev has to resort to regular C<stat> polling,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines