--- Coro/Coro.pm 2001/07/15 02:36:54 1.10 +++ Coro/Coro.pm 2001/07/15 15:58:16 1.12 @@ -28,7 +28,7 @@ use base Exporter; -$VERSION = 0.04; +$VERSION = 0.05; @EXPORT = qw(async yield schedule); @EXPORT_OK = qw($current); @@ -115,7 +115,9 @@ =cut sub async(&) { - (new Coro $_[0])->ready; + my $pid = new Coro $_[0]; + $pid->ready; + $pid; } =item schedule @@ -129,6 +131,7 @@ my $prev; sub schedule { + local @_; # should be done using priorities :( ($prev, $current) = ($current, shift @ready || $idle); Coro::State::transfer($prev, $current);