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.312 by root, Mon Feb 15 18:02:35 2010 UTC vs.
Revision 1.316 by root, Mon Mar 15 18:51:30 2010 UTC

1156 1156
1157BEGIN { AnyEvent::common_sense } 1157BEGIN { AnyEvent::common_sense }
1158 1158
1159use Carp (); 1159use Carp ();
1160 1160
1161our $VERSION = '5.24'; 1161our $VERSION = '5.251';
1162our $MODEL; 1162our $MODEL;
1163 1163
1164our $AUTOLOAD; 1164our $AUTOLOAD;
1165our @ISA; 1165our @ISA;
1166 1166
1167our @REGISTRY; 1167our @REGISTRY;
1168 1168
1169our $VERBOSE; 1169our $VERBOSE;
1170 1170
1171BEGIN { 1171BEGIN {
1172 eval "sub CYGWIN(){" . (($^O =~ /cygwin/i) *1) . "}"; 1172 require "AnyEvent/constants.pl";
1173 eval "sub WIN32 (){" . (($^O =~ /mswin32/i)*1) . "}"; 1173
1174 eval "sub TAINT (){" . (${^TAINT} *1) . "}"; 1174 eval "sub TAINT (){" . (${^TAINT} *1) . "}";
1175 1175
1176 delete @ENV{grep /^PERL_ANYEVENT_/, keys %ENV} 1176 delete @ENV{grep /^PERL_ANYEVENT_/, keys %ENV}
1177 if ${^TAINT}; 1177 if ${^TAINT};
1178 1178
1491 $SIG_IO = AE::io $SIGPIPE_R->fileno, 0, \&_signal_exec; 1491 $SIG_IO = AE::io $SIGPIPE_R->fileno, 0, \&_signal_exec;
1492 1492
1493 } else { 1493 } else {
1494 warn "AnyEvent: using emulated perl signal handling with latency timer.\n" if $VERBOSE >= 8; 1494 warn "AnyEvent: using emulated perl signal handling with latency timer.\n" if $VERBOSE >= 8;
1495 1495
1496 require Fcntl;
1497
1498 if (AnyEvent::WIN32) { 1496 if (AnyEvent::WIN32) {
1499 require AnyEvent::Util; 1497 require AnyEvent::Util;
1500 1498
1501 ($SIGPIPE_R, $SIGPIPE_W) = AnyEvent::Util::portable_pipe (); 1499 ($SIGPIPE_R, $SIGPIPE_W) = AnyEvent::Util::portable_pipe ();
1502 AnyEvent::Util::fh_nonblocking ($SIGPIPE_R, 1) if $SIGPIPE_R; 1500 AnyEvent::Util::fh_nonblocking ($SIGPIPE_R, 1) if $SIGPIPE_R;
1503 AnyEvent::Util::fh_nonblocking ($SIGPIPE_W, 1) if $SIGPIPE_W; # just in case 1501 AnyEvent::Util::fh_nonblocking ($SIGPIPE_W, 1) if $SIGPIPE_W; # just in case
1504 } else { 1502 } else {
1505 pipe $SIGPIPE_R, $SIGPIPE_W; 1503 pipe $SIGPIPE_R, $SIGPIPE_W;
1506 fcntl $SIGPIPE_R, &Fcntl::F_SETFL, &Fcntl::O_NONBLOCK if $SIGPIPE_R; 1504 fcntl $SIGPIPE_R, AnyEvent::F_SETFL, AnyEvent::O_NONBLOCK if $SIGPIPE_R;
1507 fcntl $SIGPIPE_W, &Fcntl::F_SETFL, &Fcntl::O_NONBLOCK if $SIGPIPE_W; # just in case 1505 fcntl $SIGPIPE_W, AnyEvent::F_SETFL, AnyEvent::O_NONBLOCK if $SIGPIPE_W; # just in case
1508 1506
1509 # not strictly required, as $^F is normally 2, but let's make sure... 1507 # not strictly required, as $^F is normally 2, but let's make sure...
1510 fcntl $SIGPIPE_R, &Fcntl::F_SETFD, &Fcntl::FD_CLOEXEC; 1508 fcntl $SIGPIPE_R, AnyEvent::F_SETFD, AnyEvent::FD_CLOEXEC;
1511 fcntl $SIGPIPE_W, &Fcntl::F_SETFD, &Fcntl::FD_CLOEXEC; 1509 fcntl $SIGPIPE_W, AnyEvent::F_SETFD, AnyEvent::FD_CLOEXEC;
1512 } 1510 }
1513 1511
1514 $SIGPIPE_R 1512 $SIGPIPE_R
1515 or Carp::croak "AnyEvent: unable to create a signal reporting pipe: $!\n"; 1513 or Carp::croak "AnyEvent: unable to create a signal reporting pipe: $!\n";
1516 1514
2526automatic timer adjustments even when no monotonic clock is available, 2524automatic timer adjustments even when no monotonic clock is available,
2527can take avdantage of advanced kernel interfaces such as C<epoll> and 2525can take avdantage of advanced kernel interfaces such as C<epoll> and
2528C<kqueue>, and is the fastest backend I<by far>. You can even embed 2526C<kqueue>, and is the fastest backend I<by far>. You can even embed
2529L<Glib>/L<Gtk2> in it (or vice versa, see L<EV::Glib> and L<Glib::EV>). 2527L<Glib>/L<Gtk2> in it (or vice versa, see L<EV::Glib> and L<Glib::EV>).
2530 2528
2529If you only use backends that rely on another event loop (e.g. C<Tk>),
2530then this module will do nothing for you.
2531
2531=item L<Guard> 2532=item L<Guard>
2532 2533
2533The guard module, when used, will be used to implement 2534The guard module, when used, will be used to implement
2534C<AnyEvent::Util::guard>. This speeds up guards considerably (and uses a 2535C<AnyEvent::Util::guard>. This speeds up guards considerably (and uses a
2535lot less memory), but otherwise doesn't affect guard operation much. It is 2536lot less memory), but otherwise doesn't affect guard operation much. It is
2536purely used for performance. 2537purely used for performance.
2537 2538
2538=item L<JSON> and L<JSON::XS> 2539=item L<JSON> and L<JSON::XS>
2539 2540
2540One of these modules is required when you want to read or write JSON data 2541One of these modules is required when you want to read or write JSON data
2541via L<AnyEvent::Handle>. It is also written in pure-perl, but can take 2542via L<AnyEvent::Handle>. L<JSON> is also written in pure-perl, but can take
2542advantage of the ultra-high-speed L<JSON::XS> module when it is installed. 2543advantage of the ultra-high-speed L<JSON::XS> module when it is installed.
2543
2544In fact, L<AnyEvent::Handle> will use L<JSON::XS> by default if it is
2545installed.
2546 2544
2547=item L<Net::SSLeay> 2545=item L<Net::SSLeay>
2548 2546
2549Implementing TLS/SSL in Perl is certainly interesting, but not very 2547Implementing TLS/SSL in Perl is certainly interesting, but not very
2550worthwhile: If this module is installed, then L<AnyEvent::Handle> (with 2548worthwhile: If this module is installed, then L<AnyEvent::Handle> (with

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines