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

Comparing cvsroot/Coro/Coro.pm (file contents):
Revision 1.118 by root, Mon Mar 19 15:50:48 2007 UTC vs.
Revision 1.120 by root, Fri Apr 13 03:57:15 2007 UTC

50 50
51our $idle; # idle handler 51our $idle; # idle handler
52our $main; # main coroutine 52our $main; # main coroutine
53our $current; # current coroutine 53our $current; # current coroutine
54 54
55our $VERSION = '3.55'; 55our $VERSION = '3.56';
56 56
57our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub); 57our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub);
58our %EXPORT_TAGS = ( 58our %EXPORT_TAGS = (
59 prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)], 59 prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)],
60); 60);
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