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

Comparing libev/ev.pod (file contents):
Revision 1.230 by root, Wed Apr 15 18:47:07 2009 UTC vs.
Revision 1.231 by root, Wed Apr 15 19:35:53 2009 UTC

633This function is rarely useful, but when some event callback runs for a 633This function is rarely useful, but when some event callback runs for a
634very long time without entering the event loop, updating libev's idea of 634very long time without entering the event loop, updating libev's idea of
635the current time is a good idea. 635the current time is a good idea.
636 636
637See also "The special problem of time updates" in the C<ev_timer> section. 637See also "The special problem of time updates" in the C<ev_timer> section.
638
639=item ev_suspend (loop)
640
641=item ev_resume (loop)
642
643These two functions suspend and resume a loop, for use when the loop is
644not used for a while and timeouts should not be processed.
645
646A typical use case would be an interactive program such as a game: When
647the user presses C<^Z> to suspend the game and resumes it an hour later it
648would be best to handle timeouts as if no time had actually passed while
649the program was suspended. This can be achieved by calling C<ev_suspend>
650in your C<SIGTSTP> handler, sending yourself a C<SIGSTOP> and calling
651C<ev_resume> directly afterwards to resume timer processing.
652
653Effectively, all C<ev_timer> watchers will be delayed by the time spend
654between C<ev_suspend> and C<ev_resume>, and all C<ev_periodic> watchers
655will be rescheduled (that is, they will lose any events that would have
656occured while suspended).
657
658After calling C<ev_suspend> you B<must not> call I<any> function on the
659given loop other than C<ev_resume>, and you B<must not> call C<ev_resume>
660without a previous call to C<ev_suspend>.
661
662Calling C<ev_suspend>/C<ev_resume> has the side effect of updating the
663event loop time (see C<ev_now_update>).
638 664
639=item ev_loop (loop, int flags) 665=item ev_loop (loop, int flags)
640 666
641Finally, this is it, the event handler. This function usually is called 667Finally, this is it, the event handler. This function usually is called
642after you initialised all your watchers and you want to start handling 668after you initialised all your watchers and you want to start handling

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines