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

Comparing Coro/Coro.pm (file contents):
Revision 1.140 by root, Thu Sep 27 16:25:10 2007 UTC vs.
Revision 1.141 by root, Tue Oct 2 10:38:17 2007 UTC

308 308
309=item terminate [arg...] 309=item terminate [arg...]
310 310
311Terminates the current coroutine with the given status values (see L<cancel>). 311Terminates the current coroutine with the given status values (see L<cancel>).
312 312
313=item killall
314
315Kills/terminates/cancels all coroutines except the currently running
316one. This is useful after a fork, either in the child or the parent, as
317usually only one of them should inherit the running coroutines.
318
313=cut 319=cut
314 320
315sub terminate { 321sub terminate {
316 $current->cancel (@_); 322 $current->cancel (@_);
323}
324
325sub killall {
326 for (Coro::State::list) {
327 $_->cancel
328 if $_ != $current && UNIVERSAL::isa $_, "Coro";
329 }
317} 330}
318 331
319=back 332=back
320 333
321# dynamic methods 334# dynamic methods

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines