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

Comparing Coro/Coro.pm (file contents):
Revision 1.134 by root, Sat Sep 22 14:42:56 2007 UTC vs.
Revision 1.135 by root, Sat Sep 22 22:39:15 2007 UTC

241 my $cb; 241 my $cb;
242 242
243 while () { 243 while () {
244 eval { 244 eval {
245 while () { 245 while () {
246# &{&_pool_1 or &terminate}; # crashes, would be ~5% faster
246 $cb = &_pool_1 247 $cb = &_pool_1
247 or return; 248 or &terminate;
248
249 &$cb; 249 &$cb;
250
251 return if &_pool_2;
252
253 undef $cb; 250 undef $cb;
251 &terminate if &_pool_2;
254 schedule; 252 &schedule;
255 } 253 }
256 }; 254 };
257 255
258 warn $@ if $@; 256 warn $@ if $@;
259 } 257 }
260} 258}
261 259
262sub async_pool(&@) { 260sub async_pool(&@) {
263 # this is also inlined into the unlock_scheduler 261 # this is also inlined into the unlock_scheduler
264 my $coro = (pop @async_pool) || new Coro \&pool_handler;; 262 my $coro = (pop @async_pool) || new Coro \&pool_handler;
265 263
266 $coro->{_invoke} = [@_]; 264 $coro->{_invoke} = [@_];
267 $coro->ready; 265 $coro->ready;
268 266
269 $coro 267 $coro

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines