… | |
… | |
50 | |
50 | |
51 | our $idle; # idle handler |
51 | our $idle; # idle handler |
52 | our $main; # main coroutine |
52 | our $main; # main coroutine |
53 | our $current; # current coroutine |
53 | our $current; # current coroutine |
54 | |
54 | |
55 | our $VERSION = '3.42'; |
55 | our $VERSION = '3.55'; |
56 | |
56 | |
57 | our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub); |
57 | our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub); |
58 | our %EXPORT_TAGS = ( |
58 | our %EXPORT_TAGS = ( |
59 | prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)], |
59 | prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)], |
60 | ); |
60 | ); |
… | |
… | |
242 | warn $@ if $@; |
242 | warn $@ if $@; |
243 | |
243 | |
244 | last if @pool >= $POOL_SIZE; |
244 | last if @pool >= $POOL_SIZE; |
245 | push @pool, $current; |
245 | push @pool, $current; |
246 | |
246 | |
|
|
247 | $current->save (Coro::State::SAVE_DEF); |
247 | $current->prio (0); |
248 | $current->prio (0); |
248 | schedule; |
249 | schedule; |
249 | } |
250 | } |
250 | } |
251 | } |
251 | |
252 | |