--- Coro/Coro.pm 2007/02/28 11:43:03 1.115 +++ Coro/Coro.pm 2007/04/13 12:56:55 1.121 @@ -52,7 +52,7 @@ our $main; # main coroutine our $current; # current coroutine -our $VERSION = '3.501'; +our $VERSION = '3.56'; our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub); our %EXPORT_TAGS = ( @@ -187,7 +187,9 @@ (usually unused). When the sub returns the new coroutine is automatically terminated. -Calling C in a coroutine will not work correctly, so do not do that. +Calling C in a coroutine will try to do the same as calling exit +outside the coroutine, but this is experimental. It is best not to rely on +exit doing any cleanups or even not crashing. When the coroutine dies, the program will exit, just as in the main program. @@ -244,6 +246,7 @@ last if @pool >= $POOL_SIZE; push @pool, $current; + $current->save (Coro::State::SAVE_DEF); $current->prio (0); schedule; } @@ -327,7 +330,7 @@ called. To make the coroutine run you must first put it into the ready queue by calling the ready method. -Calling C in a coroutine will not work correctly, so do not do that. +See C for additional discussion. =cut @@ -467,7 +470,7 @@ =item my $guard = Coro::guard { ... } -This creates and returns a guard object. Nothing happens until the objetc +This creates and returns a guard object. Nothing happens until the object gets destroyed, in which case the codeblock given as argument will be executed. This is useful to free locks or other resources in case of a runtime error or when the coroutine gets canceled, as in both cases the