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

Comparing libev/ev.pod (file contents):
Revision 1.289 by root, Tue Mar 16 17:11:49 2010 UTC vs.
Revision 1.290 by root, Tue Mar 16 18:03:01 2010 UTC

567 ev_default_loop (ev_recommended_backends () | EVBACKEND_KQUEUE); 567 ev_default_loop (ev_recommended_backends () | EVBACKEND_KQUEUE);
568 568
569=item struct ev_loop *ev_loop_new (unsigned int flags) 569=item struct ev_loop *ev_loop_new (unsigned int flags)
570 570
571Similar to C<ev_default_loop>, but always creates a new event loop that is 571Similar to C<ev_default_loop>, but always creates a new event loop that is
572always distinct from the default loop. Unlike the default loop, it cannot 572always distinct from the default loop.
573handle signal and child watchers, and attempts to do so will be greeted by
574undefined behaviour (or a failed assertion if assertions are enabled).
575 573
576Note that this function I<is> thread-safe, and the recommended way to use 574Note that this function I<is> thread-safe, and one common way to use
577libev with threads is indeed to create one loop per thread, and using the 575libev with threads is indeed to create one loop per thread, and using the
578default loop in the "main" or "initial" thread. 576default loop in the "main" or "initial" thread.
579 577
580Example: Try to create a event loop that uses epoll and nothing else. 578Example: Try to create a event loop that uses epoll and nothing else.
581 579
583 if (!epoller) 581 if (!epoller)
584 fatal ("no epoll found here, maybe it hides under your chair"); 582 fatal ("no epoll found here, maybe it hides under your chair");
585 583
586=item ev_default_destroy () 584=item ev_default_destroy ()
587 585
588Destroys the default loop again (frees all memory and kernel state 586Destroys the default loop (frees all memory and kernel state etc.). None
589etc.). None of the active event watchers will be stopped in the normal 587of the active event watchers will be stopped in the normal sense, so
590sense, so e.g. C<ev_is_active> might still return true. It is your 588e.g. C<ev_is_active> might still return true. It is your responsibility to
591responsibility to either stop all watchers cleanly yourself I<before> 589either stop all watchers cleanly yourself I<before> calling this function,
592calling this function, or cope with the fact afterwards (which is usually 590or cope with the fact afterwards (which is usually the easiest thing, you
593the easiest thing, you can just ignore the watchers and/or C<free ()> them 591can just ignore the watchers and/or C<free ()> them for example).
594for example).
595 592
596Note that certain global state, such as signal state (and installed signal 593Note that certain global state, such as signal state (and installed signal
597handlers), will not be freed by this function, and related watchers (such 594handlers), will not be freed by this function, and related watchers (such
598as signal and child watchers) would need to be stopped manually. 595as signal and child watchers) would need to be stopped manually.
599 596

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines