--- libev/ev.pod 2012/04/02 18:39:54 1.398 +++ libev/ev.pod 2012/04/02 23:14:41 1.399 @@ -794,18 +794,22 @@ Calling C/C has the side effect of updating the event loop time (see C). -=item ev_run (loop, int flags) +=item bool ev_run (loop, int flags) Finally, this is it, the event handler. This function usually is called after you have initialised all your watchers and you want to start handling events. It will ask the operating system for any new events, call -the watcher callbacks, an then repeat the whole process indefinitely: This +the watcher callbacks, and then repeat the whole process indefinitely: This is why event loops are called I. If the flags argument is specified as C<0>, it will keep handling events until either no event watchers are active anymore or C was called. +The return value is false if there are no more active watchers (which +usually means "all jobs done" or "deadlock"), and true in all other cases +(which usually means " you should call C again"). + Please note that an explicit C is usually better than relying on all watchers to be stopped when deciding when a program has finished (especially in interactive programs), but having a program @@ -813,8 +817,8 @@ of relying on its watchers stopping correctly, that is truly a thing of beauty. -This function is also I exception-safe - you can break out of -a C call by calling C in a callback, throwing a C++ +This function is I exception-safe - you can break out of a +C call by calling C in a callback, throwing a C++ exception and so on. This does not decrement the C value, nor will it clear any outstanding C breaks.