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

Comparing Coro/Coro.pm (file contents):
Revision 1.221 by root, Tue Nov 18 05:51:38 2008 UTC vs.
Revision 1.222 by root, Tue Nov 18 08:59:46 2008 UTC

436} 436}
437 437
438=item $coroutine->throw ([$scalar]) 438=item $coroutine->throw ([$scalar])
439 439
440If C<$throw> is specified and defined, it will be thrown as an exception 440If C<$throw> is specified and defined, it will be thrown as an exception
441inside the coroutine at the next convenient point in time (usually after 441inside the coroutine at the next convenient point in time. Otherwise
442it gains control at the next schedule/transfer/cede). Otherwise clears the
443exception object. 442clears the exception object.
443
444Coro will check for the exception each time a schedule-like-function
445returns, i.e. after each C<schedule>, C<cede>, C<< Coro::Semaphore->down
446>>, C<< Coro::Handle->readable >> and so on. Note that this means that
447when a coroutine is acquiring a lock, it might only throw after it has
448sucessfully acquired it.
444 449
445The exception object will be thrown "as is" with the specified scalar in 450The exception object will be thrown "as is" with the specified scalar in
446C<$@>, i.e. if it is a string, no line number or newline will be appended 451C<$@>, i.e. if it is a string, no line number or newline will be appended
447(unlike with C<die>). 452(unlike with C<die>).
448 453

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines