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

Comparing Coro/Coro/Debug.pm (file contents):
Revision 1.35 by root, Wed Oct 3 17:12:20 2007 UTC vs.
Revision 1.36 by root, Wed Oct 3 17:37:33 2007 UTC

350 350
351sub session($) { 351sub session($) {
352 my ($fh) = @_; 352 my ($fh) = @_;
353 353
354 $fh = Coro::Handle::unblock $fh; 354 $fh = Coro::Handle::unblock $fh;
355 select $fh; 355 my $old_fh = select $fh;
356 my $guard = Coro::guard { select $old_fh };
356 357
357 my $loglevel = $SESLOGLEVEL; 358 my $loglevel = $SESLOGLEVEL;
358 local $log{$Coro::current} = sub { 359 local $log{$Coro::current} = sub {
359 return unless $_[0] <= $loglevel; 360 return unless $_[0] <= $loglevel;
360 print $fh "\015", (format_msg $_[0], $_[1]), "> "; 361 print $fh "\015", (format_msg $_[0], $_[1]), "> ";
410 fh => $fh, 411 fh => $fh,
411 path => $path, 412 path => $path,
412 }, $class; 413 }, $class;
413 414
414 $self->{cw} = AnyEvent->io (fh => $fh, poll => 'r', cb => sub { 415 $self->{cw} = AnyEvent->io (fh => $fh, poll => 'r', cb => sub {
415 Coro::async { 416 Coro::async_pool {
416 warn select;#d#
417 $Coro::current->desc ("[Coro::Debug session]"); 417 $Coro::current->desc ("[Coro::Debug session]");
418 my $fh = $fh->accept;
419 session $fh; 418 session +$fh->accept;
420 close $fh;
421 }; 419 };
422 }); 420 });
423 421
424 $self 422 $self
425} 423}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines