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.135 by root, Sun May 25 04:49:01 2008 UTC vs.
Revision 1.137 by root, Mon May 26 03:27:52 2008 UTC

741 741
742our @REGISTRY; 742our @REGISTRY;
743 743
744our $verbose = $ENV{PERL_ANYEVENT_VERBOSE}*1; 744our $verbose = $ENV{PERL_ANYEVENT_VERBOSE}*1;
745 745
746our %PROTOCOL; # (ipv4|ipv6) => (1|2) 746our %PROTOCOL; # (ipv4|ipv6) => (1|2), higher numbers are preferred
747 747
748{ 748{
749 my $idx; 749 my $idx;
750 $PROTOCOL{$_} = ++$idx 750 $PROTOCOL{$_} = ++$idx
751 for reverse split /\s*,\s*/,
751 for split /\s*,\s*/, $ENV{PERL_ANYEVENT_PROTOCOLS} || "ipv4,ipv6"; 752 $ENV{PERL_ANYEVENT_PROTOCOLS} || "ipv4,ipv6";
752} 753}
753 754
754my @models = ( 755my @models = (
755 [EV:: => AnyEvent::Impl::EV::], 756 [EV:: => AnyEvent::Impl::EV::],
756 [Event:: => AnyEvent::Impl::Event::], 757 [Event:: => AnyEvent::Impl::Event::],
792} 793}
793 794
794sub detect() { 795sub detect() {
795 unless ($MODEL) { 796 unless ($MODEL) {
796 no strict 'refs'; 797 no strict 'refs';
798 local $SIG{__DIE__};
797 799
798 if ($ENV{PERL_ANYEVENT_MODEL} =~ /^([a-zA-Z]+)$/) { 800 if ($ENV{PERL_ANYEVENT_MODEL} =~ /^([a-zA-Z]+)$/) {
799 my $model = "AnyEvent::Impl::$1"; 801 my $model = "AnyEvent::Impl::$1";
800 if (eval "require $model") { 802 if (eval "require $model") {
801 $MODEL = $model; 803 $MODEL = $model;
924 or Carp::croak "required option 'pid' is missing"; 926 or Carp::croak "required option 'pid' is missing";
925 927
926 $PID_CB{$pid}{$arg{cb}} = $arg{cb}; 928 $PID_CB{$pid}{$arg{cb}} = $arg{cb};
927 929
928 unless ($WNOHANG) { 930 unless ($WNOHANG) {
929 $WNOHANG = eval { require POSIX; &POSIX::WNOHANG } || 1; 931 $WNOHANG = eval { local $SIG{__DIE__}; require POSIX; &POSIX::WNOHANG } || 1;
930 } 932 }
931 933
932 unless ($CHLD_W) { 934 unless ($CHLD_W) {
933 $CHLD_W = AnyEvent->signal (signal => 'CHLD', cb => \&_sigchld); 935 $CHLD_W = AnyEvent->signal (signal => 'CHLD', cb => \&_sigchld);
934 # child could be a zombie already, so make at least one round 936 # child could be a zombie already, so make at least one round

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines