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

Comparing Coro/Coro.pm (file contents):
Revision 1.108 by root, Fri Jan 5 20:00:49 2007 UTC vs.
Revision 1.111 by root, Sun Jan 14 21:13:48 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.4';
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);
233our $POOL_SIZE = 8; 233our $POOL_SIZE = 8;
234our @pool; 234our @pool;
235 235
236sub pool_handler { 236sub pool_handler {
237 while () { 237 while () {
238 my ($cb, @arg) = @{ delete $current->{_invoke} };
239
240 eval { 238 eval {
239 my ($cb, @arg) = @{ delete $current->{_invoke} or return };
241 $cb->(@arg); 240 $cb->(@arg);
242 }; 241 };
243 warn $@ if $@; 242 warn $@ if $@;
244 243
245 last if @pool >= $POOL_SIZE; 244 last if @pool >= $POOL_SIZE;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines