sub busywork { print 'busy' };
my $n = 12;
my $th_sub = sub {
my ($limit) = @_;
foreach ( 1 .. $limit ) {
print '.';
cede;
}
};
my $th = Coro->new( $th_sub, $n );
$th->ready;
foreach my $ii ( 1 .. $n ) {
if ( $ii == int $n * 2/3 ) {
$Coro::current->prio(-1);
cede;
busywork();
}
print '-';
cede;
}