… | |
… | |
605 | returning, ev_unref() after starting, and ev_ref() before stopping it. For |
605 | returning, ev_unref() after starting, and ev_ref() before stopping it. For |
606 | example, libev itself uses this for its internal signal pipe: It is not |
606 | example, libev itself uses this for its internal signal pipe: It is not |
607 | visible to the libev user and should not keep C<ev_loop> from exiting if |
607 | visible to the libev user and should not keep C<ev_loop> from exiting if |
608 | no event watchers registered by it are active. It is also an excellent |
608 | no event watchers registered by it are active. It is also an excellent |
609 | way to do this for generic recurring timers or from within third-party |
609 | way to do this for generic recurring timers or from within third-party |
610 | libraries. Just remember to I<unref after start> and I<ref before stop>. |
610 | libraries. Just remember to I<unref after start> and I<ref before stop> |
|
|
611 | (but only if the watcher wasn't active before, or was active before, |
|
|
612 | respectively). |
611 | |
613 | |
612 | Example: Create a signal watcher, but keep it from keeping C<ev_loop> |
614 | Example: Create a signal watcher, but keep it from keeping C<ev_loop> |
613 | running when nothing else is active. |
615 | running when nothing else is active. |
614 | |
616 | |
615 | struct ev_signal exitsig; |
617 | struct ev_signal exitsig; |