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

Comparing AnyEvent/lib/AnyEvent.pm (file contents):
Revision 1.29 by root, Wed Oct 31 14:17:43 2007 UTC vs.
Revision 1.30 by root, Fri Nov 2 19:12:02 2007 UTC

349 my (undef, %arg) = @_; 349 my (undef, %arg) = @_;
350 350
351 my $signal = uc $arg{signal} 351 my $signal = uc $arg{signal}
352 or Carp::croak "required option 'signal' is missing"; 352 or Carp::croak "required option 'signal' is missing";
353 353
354 $SIG_CB{$signal}{$arg{cb}} = $arg{cb}; 354 $SIG_CB{$signal}{$arg{cb} += 0} = $arg{cb};
355 $SIG{$signal} ||= sub { 355 $SIG{$signal} ||= sub {
356 $_->() for values %{ $SIG_CB{$signal} || {} }; 356 $_->() for values %{ $SIG_CB{$signal} || {} };
357 }; 357 };
358 358
359 bless [$signal, $arg{cb}], "AnyEvent::Base::Signal" 359 bless [$signal, $arg{cb}], "AnyEvent::Base::Signal"
374our $PID_IDLE; 374our $PID_IDLE;
375our $WNOHANG; 375our $WNOHANG;
376 376
377sub _child_wait { 377sub _child_wait {
378 while (0 < (my $pid = waitpid -1, $WNOHANG)) { 378 while (0 < (my $pid = waitpid -1, $WNOHANG)) {
379 $_->() for values %{ (delete $PID_CB{$pid}) || {} }; 379 $_->() for values %{ $PID_CB{$pid} || {} }, %{ $PID_CB{0} || {} };
380 } 380 }
381 381
382 undef $PID_IDLE; 382 undef $PID_IDLE;
383} 383}
384 384

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines