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

Comparing libev/ev.pod (file contents):
Revision 1.293 by root, Wed Mar 24 18:27:13 2010 UTC vs.
Revision 1.296 by root, Tue Jun 29 10:51:18 2010 UTC

192as this indicates an incompatible change. Minor versions are usually 192as this indicates an incompatible change. Minor versions are usually
193compatible to older versions, so a larger minor version alone is usually 193compatible to older versions, so a larger minor version alone is usually
194not a problem. 194not a problem.
195 195
196Example: Make sure we haven't accidentally been linked against the wrong 196Example: Make sure we haven't accidentally been linked against the wrong
197version. 197version (note, however, that this will not detect ABI mismatches :).
198 198
199 assert (("libev version mismatch", 199 assert (("libev version mismatch",
200 ev_version_major () == EV_VERSION_MAJOR 200 ev_version_major () == EV_VERSION_MAJOR
201 && ev_version_minor () >= EV_VERSION_MINOR)); 201 && ev_version_minor () >= EV_VERSION_MINOR));
202 202
1404 { 1404 {
1405 // stop the I/O watcher, we received the event, but 1405 // stop the I/O watcher, we received the event, but
1406 // are not yet ready to handle it. 1406 // are not yet ready to handle it.
1407 ev_io_stop (EV_A_ w); 1407 ev_io_stop (EV_A_ w);
1408 1408
1409 // start the idle watcher to ahndle the actual event. 1409 // start the idle watcher to handle the actual event.
1410 // it will not be executed as long as other watchers 1410 // it will not be executed as long as other watchers
1411 // with the default priority are receiving events. 1411 // with the default priority are receiving events.
1412 ev_idle_start (EV_A_ &idle); 1412 ev_idle_start (EV_A_ &idle);
1413 } 1413 }
1414 1414
1774 callback (loop, timer, EV_TIMER); 1774 callback (loop, timer, EV_TIMER);
1775 1775
1776And when there is some activity, simply store the current time in 1776And when there is some activity, simply store the current time in
1777C<last_activity>, no libev calls at all: 1777C<last_activity>, no libev calls at all:
1778 1778
1779 last_actiivty = ev_now (loop); 1779 last_activity = ev_now (loop);
1780 1780
1781This technique is slightly more complex, but in most cases where the 1781This technique is slightly more complex, but in most cases where the
1782time-out is unlikely to be triggered, much more efficient. 1782time-out is unlikely to be triggered, much more efficient.
1783 1783
1784Changing the timeout is trivial as well (if it isn't hard-coded in the 1784Changing the timeout is trivial as well (if it isn't hard-coded in the

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines