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

Comparing Coro/Coro.pm (file contents):
Revision 1.149 by root, Sat Oct 6 00:39:07 2007 UTC vs.
Revision 1.150 by root, Sat Oct 6 01:11:01 2007 UTC

471coroutine. This is just a free-form string you can associate with a coroutine. 471coroutine. This is just a free-form string you can associate with a coroutine.
472 472
473This method simply sets the C<< $coroutine->{desc} >> member to the given string. You 473This method simply sets the C<< $coroutine->{desc} >> member to the given string. You
474can modify this member directly if you wish. 474can modify this member directly if you wish.
475 475
476=item $coroutine->throw ([$scalar])
477
478If C<$throw> is specified and defined, it will be thrown as an exception
479inside the coroutine at the next convinient point in time (usually after
480it gains control at the next schedule/transfer/cede). Otherwise clears the
481exception object.
482
483The exception object will be thrown "as is" with the specified scalar in
484C<$@>, i.e. if it is a string, no line number or newline will be appended
485(unlike with C<die>).
486
487This can be used as a softer means than C<cancel> to ask a coroutine to
488end itself, although there is no guarentee that the exception will lead to
489termination, and if the exception isn't caught it might well end the whole
490program.
491
476=cut 492=cut
477 493
478sub desc { 494sub desc {
479 my $old = $_[0]{desc}; 495 my $old = $_[0]{desc};
480 $_[0]{desc} = $_[1] if @_ > 1; 496 $_[0]{desc} = $_[1] if @_ > 1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines