--- AnyEvent-Fork-Pool/Pool.pm 2013/04/21 11:17:02 1.6 +++ AnyEvent-Fork-Pool/Pool.pm 2013/04/21 12:03:02 1.7 @@ -330,6 +330,8 @@ Array::Heap::splice_heap_idx @pool, $proc->[1] if defined $proc->[1]; + + @$proc = 0; # tell others to leave it be }; $want_start = sub { @@ -358,6 +360,8 @@ $scheduler = sub { if (@queue) { while (@queue) { + @pool or $start_worker->(); + my $proc = $pool[0]; if ($proc->[0] < $load) { @@ -385,9 +389,9 @@ Array::Heap::adjust_heap_idx @pool, $proc->[1] if defined $proc->[1]; - $scheduler->(); - &$ocb; + + $scheduler->(); }); } else { $want_start->() @@ -515,6 +519,12 @@ =back +=head1 EXCEPTIONS + +The same "policy" as with L applies - exceptins will +not be caught, and exceptions in both worker and in callbacks causes +undesirable or undefined behaviour. + =head1 SEE ALSO L, to create the processes in the first place.