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

Comparing AnyEvent/lib/AnyEvent/Impl/Glib.pm (file contents):
Revision 1.9 by root, Mon Dec 11 01:16:09 2006 UTC vs.
Revision 1.11 by root, Sun Jul 8 08:52:10 2007 UTC

1package AnyEvent::Impl::Glib; 1package AnyEvent::Impl::Glib;
2 2
3no warnings; 3no warnings;
4use strict;
4 5
5use Glib (); 6use Glib ();
6 7
7my $maincontext = Glib::MainContext->default; 8my $maincontext = Glib::MainContext->default;
8 9
10 my ($class, %arg) = @_; 11 my ($class, %arg) = @_;
11 12
12 my $self = bless \%arg, $class; 13 my $self = bless \%arg, $class;
13 my $rcb = \$self->{cb}; 14 my $rcb = \$self->{cb};
14 15
16 my @cond;
15 # some glibs need hup, others error with it, YMMV 17 # some glibs need hup, others error with it, YMMV
16 push @cond, "in", "hup" if $self->{poll} eq "r"; 18 push @cond, "in", "hup" if $self->{poll} eq "r";
17 push @cond, "out", "hup" if $self->{poll} eq "w"; 19 push @cond, "out", "hup" if $self->{poll} eq "w";
18 20
19 $self->{source} = add_watch Glib::IO fileno $self->{fh}, \@cond, sub { 21 $self->{source} = add_watch Glib::IO fileno $self->{fh}, \@cond, sub {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines