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

Comparing libev/ev.pod (file contents):
Revision 1.354 by root, Tue Jan 11 01:40:25 2011 UTC vs.
Revision 1.355 by root, Tue Jan 11 01:41:56 2011 UTC

3456 3456
3457This section explains some common idioms that are not immediately 3457This section explains some common idioms that are not immediately
3458obvious. Note that examples are sprinkled over the whole manual, and this 3458obvious. Note that examples are sprinkled over the whole manual, and this
3459section only contains stuff that wouldn't fit anywhere else. 3459section only contains stuff that wouldn't fit anywhere else.
3460 3460
3461=over 4 3461=head2 MODEL/NESTED EVENT LOOP INVOCATIONS AND EXIT CONDITIONS
3462
3463=item Model/nested event loop invocations and exit conditions.
3464 3462
3465Often (especially in GUI toolkits) there are places where you have 3463Often (especially in GUI toolkits) there are places where you have
3466I<modal> interaction, which is most easily implemented by recursively 3464I<modal> interaction, which is most easily implemented by recursively
3467invoking C<ev_run>. 3465invoking C<ev_run>.
3468 3466
3497 exit_main_loop = 1; 3495 exit_main_loop = 1;
3498 3496
3499 // exit both 3497 // exit both
3500 exit_main_loop = exit_nested_loop = 1; 3498 exit_main_loop = exit_nested_loop = 1;
3501 3499
3502=item Thread locking example 3500=head2 THREAD LOCKING EXAMPLE
3503 3501
3504Here is a fictitious example of how to run an event loop in a different 3502Here is a fictitious example of how to run an event loop in a different
3505thread than where callbacks are being invoked and watchers are 3503thread than where callbacks are being invoked and watchers are
3506created/added/removed. 3504created/added/removed.
3507 3505
4636default loop and triggering an C<ev_async> watcher from the default loop 4634default loop and triggering an C<ev_async> watcher from the default loop
4637watcher callback into the event loop interested in the signal. 4635watcher callback into the event loop interested in the signal.
4638 4636
4639=back 4637=back
4640 4638
4641See also L<Thread locking example>. 4639See also L<THREAD LOCKING EXAMPLE>.
4642 4640
4643=head3 COROUTINES 4641=head3 COROUTINES
4644 4642
4645Libev is very accommodating to coroutines ("cooperative threads"): 4643Libev is very accommodating to coroutines ("cooperative threads"):
4646libev fully supports nesting calls to its functions from different 4644libev fully supports nesting calls to its functions from different

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines