… | |
… | |
36 | |
36 | |
37 | use Coro::State; |
37 | use Coro::State; |
38 | |
38 | |
39 | use base Exporter; |
39 | use base Exporter; |
40 | |
40 | |
41 | $VERSION = 0.49; |
41 | $VERSION = 0.5; |
42 | |
42 | |
43 | @EXPORT = qw(async cede schedule terminate current); |
43 | @EXPORT = qw(async cede schedule terminate current); |
44 | %EXPORT_TAGS = ( |
44 | %EXPORT_TAGS = ( |
45 | prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)], |
45 | prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)], |
46 | ); |
46 | ); |
… | |
… | |
229 | =cut |
229 | =cut |
230 | |
230 | |
231 | sub cancel { |
231 | sub cancel { |
232 | push @destroy, $_[0]; |
232 | push @destroy, $_[0]; |
233 | $manager->ready; |
233 | $manager->ready; |
|
|
234 | &schedule if $current == $_[0]; |
234 | } |
235 | } |
235 | |
236 | |
236 | =item $oldprio = $process->prio($newprio) |
237 | =item $oldprio = $process->prio($newprio) |
237 | |
238 | |
238 | Sets the priority of the process. Higher priority processes get run before |
239 | Sets the priority of the process. Higher priority processes get run before |