ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro.pm
(Generate patch)

Comparing Coro/Coro.pm (file contents):
Revision 1.118 by root, Mon Mar 19 15:50:48 2007 UTC vs.
Revision 1.119 by root, Wed Mar 28 14:24:17 2007 UTC

466and C<schedule> would cause a deadlock unless there is an idle handler 466and C<schedule> would cause a deadlock unless there is an idle handler
467that wakes up some coroutines. 467that wakes up some coroutines.
468 468
469=item my $guard = Coro::guard { ... } 469=item my $guard = Coro::guard { ... }
470 470
471This creates and returns a guard object. Nothing happens until the objetc 471This creates and returns a guard object. Nothing happens until the object
472gets destroyed, in which case the codeblock given as argument will be 472gets destroyed, in which case the codeblock given as argument will be
473executed. This is useful to free locks or other resources in case of a 473executed. This is useful to free locks or other resources in case of a
474runtime error or when the coroutine gets canceled, as in both cases the 474runtime error or when the coroutine gets canceled, as in both cases the
475guard block will be executed. The guard object supports only one method, 475guard block will be executed. The guard object supports only one method,
476C<< ->cancel >>, which will keep the codeblock from being executed. 476C<< ->cancel >>, which will keep the codeblock from being executed.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines