… | |
… | |
242 | last if @pool >= $POOL_SIZE; |
242 | last if @pool >= $POOL_SIZE; |
243 | push @pool, $current; |
243 | push @pool, $current; |
244 | |
244 | |
245 | $current->prio (0); |
245 | $current->prio (0); |
246 | schedule; |
246 | schedule; |
247 | } |
247 | } |
248 | } |
248 | } |
249 | |
249 | |
250 | sub async_pool(&@) { |
250 | sub async_pool(&@) { |
251 | # this is also inlined into the unlock_scheduler |
251 | # this is also inlined into the unlock_scheduler |
252 | my $coro = (pop @pool or new Coro \&pool_handler); |
252 | my $coro = (pop @pool or new Coro \&pool_handler); |
253 | |
253 | |