ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro.pm
(Generate patch)

Comparing Coro/Coro.pm (file contents):
Revision 1.109 by root, Fri Jan 12 01:15:03 2007 UTC vs.
Revision 1.114 by root, Wed Jan 24 16:22:08 2007 UTC

50 50
51our $idle; # idle handler 51our $idle; # idle handler
52our $main; # main coroutine 52our $main; # main coroutine
53our $current; # current coroutine 53our $current; # current coroutine
54 54
55our $VERSION = '3.3'; 55our $VERSION = '3.5';
56 56
57our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub); 57our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub);
58our %EXPORT_TAGS = ( 58our %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);
234our @pool; 234our @pool;
235 235
236sub pool_handler { 236sub pool_handler {
237 while () { 237 while () {
238 eval { 238 eval {
239 my ($cb, @arg) = @{ delete $current->{_invoke} }; 239 my ($cb, @arg) = @{ delete $current->{_invoke} or return };
240 $cb->(@arg); 240 $cb->(@arg);
241 }; 241 };
242 warn $@ if $@; 242 warn $@ if $@;
243 243
244 last if @pool >= $POOL_SIZE; 244 last if @pool >= $POOL_SIZE;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines