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.136 by root, Sun May 25 23:52:02 2008 UTC vs.
Revision 1.140 by root, Mon May 26 06:18:53 2008 UTC

731no warnings; 731no warnings;
732use strict; 732use strict;
733 733
734use Carp; 734use Carp;
735 735
736our $VERSION = '4.03'; 736our $VERSION = '4.04';
737our $MODEL; 737our $MODEL;
738 738
739our $AUTOLOAD; 739our $AUTOLOAD;
740our @ISA; 740our @ISA;
741 741
742our @REGISTRY; 742our @REGISTRY;
743
744our $WIN32;
745
746BEGIN {
747 my $win32 = ! ! ($^O =~ /mswin32/i);
748 eval "sub WIN32(){ $win32 }";
749}
743 750
744our $verbose = $ENV{PERL_ANYEVENT_VERBOSE}*1; 751our $verbose = $ENV{PERL_ANYEVENT_VERBOSE}*1;
745 752
746our %PROTOCOL; # (ipv4|ipv6) => (1|2), higher numbers are preferred 753our %PROTOCOL; # (ipv4|ipv6) => (1|2), higher numbers are preferred
747 754
793} 800}
794 801
795sub detect() { 802sub detect() {
796 unless ($MODEL) { 803 unless ($MODEL) {
797 no strict 'refs'; 804 no strict 'refs';
805 local $SIG{__DIE__};
798 806
799 if ($ENV{PERL_ANYEVENT_MODEL} =~ /^([a-zA-Z]+)$/) { 807 if ($ENV{PERL_ANYEVENT_MODEL} =~ /^([a-zA-Z]+)$/) {
800 my $model = "AnyEvent::Impl::$1"; 808 my $model = "AnyEvent::Impl::$1";
801 if (eval "require $model") { 809 if (eval "require $model") {
802 $MODEL = $model; 810 $MODEL = $model;
925 or Carp::croak "required option 'pid' is missing"; 933 or Carp::croak "required option 'pid' is missing";
926 934
927 $PID_CB{$pid}{$arg{cb}} = $arg{cb}; 935 $PID_CB{$pid}{$arg{cb}} = $arg{cb};
928 936
929 unless ($WNOHANG) { 937 unless ($WNOHANG) {
930 $WNOHANG = eval { require POSIX; &POSIX::WNOHANG } || 1; 938 $WNOHANG = eval { local $SIG{__DIE__}; require POSIX; &POSIX::WNOHANG } || 1;
931 } 939 }
932 940
933 unless ($CHLD_W) { 941 unless ($CHLD_W) {
934 $CHLD_W = AnyEvent->signal (signal => 'CHLD', cb => \&_sigchld); 942 $CHLD_W = AnyEvent->signal (signal => 'CHLD', cb => \&_sigchld);
935 # child could be a zombie already, so make at least one round 943 # child could be a zombie already, so make at least one round

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines