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.28 by root, Sat Oct 27 15:10:09 2007 UTC vs.
Revision 1.30 by root, Fri Nov 2 19:12:02 2007 UTC

195C<AnyEvent::Impl:xxx> modules, but can be any other class in the case 195C<AnyEvent::Impl:xxx> modules, but can be any other class in the case
196AnyEvent has been extended at runtime (e.g. in I<rxvt-unicode>). 196AnyEvent has been extended at runtime (e.g. in I<rxvt-unicode>).
197 197
198The known classes so far are: 198The known classes so far are:
199 199
200 EV::AnyEvent based on EV (an interface to libev, best choice)
200 AnyEvent::Impl::Coro based on Coro::Event, best choice. 201 AnyEvent::Impl::Coro based on Coro::Event, second best choice.
201 EV::AnyEvent based on EV (an interface to libevent)
202 AnyEvent::Impl::Event based on Event, also best choice :) 202 AnyEvent::Impl::Event based on Event, also second best choice :)
203 AnyEvent::Impl::Glib based on Glib, second-best choice. 203 AnyEvent::Impl::Glib based on Glib, second-best choice.
204 AnyEvent::Impl::Tk based on Tk, very bad choice. 204 AnyEvent::Impl::Tk based on Tk, very bad choice.
205 AnyEvent::Impl::Perl pure-perl implementation, inefficient. 205 AnyEvent::Impl::Perl pure-perl implementation, inefficient.
206 206
207=item AnyEvent::detect 207=item AnyEvent::detect
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