ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/myhttpd/access.pl
(Generate patch)

Comparing Coro/myhttpd/access.pl (file contents):
Revision 1.12 by root, Thu Nov 29 01:53:40 2001 UTC vs.
Revision 1.13 by root, Thu Nov 29 02:30:04 2001 UTC

12 12
13 my $trans = bless [ $self, $Coro::current ], transfer::; 13 my $trans = bless [ $self, $Coro::current ], transfer::;
14 Scalar::Util::weaken($trans->[0]); 14 Scalar::Util::weaken($trans->[0]);
15 15
16 push @{$self->{wait}}, $trans; 16 push @{$self->{wait}}, $trans;
17 Scalar::Util::weaken($self->{wait}[-1]);
17 18
18 if (--$self->{conns} >= 0) { 19 if (--$self->{conns} >= 0) {
19 $self->wake_next; 20 $self->wake_next;
20 } 21 }
21 22
25sub wake_next { 26sub wake_next {
26 my $self = shift; 27 my $self = shift;
27 28
28 return unless $self->{conns} >= 0; 29 return unless $self->{conns} >= 0;
29 30
30 (pop @{$self->{wait}})->wake if @{$self->{wait}}; 31 if (@{$self->{wait}}) {
32 while() {
33 my $transfer = shift @{$self->{wait}};
34 if ($transfer) {
35 $transfer->wake;
36 last;
37 }
38 }
39 }
31} 40}
32 41
33sub waiters { 42sub waiters {
34 map $_->[1], @{$_[0]{wait}}; 43 map $_->[1], @{$_[0]{wait}};
35} 44}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines