--- cvsroot/Coro/Coro.pm 2007/09/22 22:39:15 1.135 +++ cvsroot/Coro/Coro.pm 2007/09/26 19:26:48 1.137 @@ -157,6 +157,10 @@ for @{(delete $self->{destroy_cb}) || []}; } +sub _do_trace { + $current->{_trace_cb}->(); +} + # this coroutine is necessary because a coroutine # cannot destroy itself. my @destroy; @@ -243,16 +247,14 @@ while () { eval { while () { -# &{&_pool_1 or &terminate}; # crashes, would be ~5% faster - $cb = &_pool_1 - or &terminate; + _pool_1 $cb; &$cb; - undef $cb; - &terminate if &_pool_2; + _pool_2 $cb; &schedule; } }; + last if $@ eq "\3terminate\2\n"; warn $@ if $@; } }