ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Event/Select.pm
(Generate patch)

Comparing Coro/Event/Select.pm (file contents):
Revision 1.11 by root, Wed Nov 1 21:39:03 2006 UTC vs.
Revision 1.12 by root, Wed Nov 1 21:43:37 2006 UTC

47 } 47 }
48} 48}
49 49
50sub select(;*$$$) { # not the correct prototype, but well... :() 50sub select(;*$$$) { # not the correct prototype, but well... :()
51 if (@_ == 0) { 51 if (@_ == 0) {
52 return CORE::select; 52 return CORE::select
53 } elsif (@_ == 1) { 53 } elsif (@_ == 1) {
54 return CORE::select $_[0]; 54 return CORE::select $_[0]
55 } elsif (defined $_[3] && !$_[3]) { 55 } elsif (defined $_[3] && !$_[3]) {
56 return &CORE::select (@_); 56 return CORE::select $_[0], $_[1], $_[2], $_[3]
57 } else { 57 } else {
58 my $current = $Coro::current; 58 my $current = $Coro::current;
59 my $nfound = 0; 59 my $nfound = 0;
60 my @w; 60 my @w;
61 for ([0, 'r'], [1, 'w'], [2, 'e']) { 61 for ([0, 'r'], [1, 'w'], [2, 'e']) {
83 83
84 Coro::schedule; 84 Coro::schedule;
85 # wait here 85 # wait here
86 86
87 $_->cancel for @w; 87 $_->cancel for @w;
88 return $nfound; 88 return $nfound
89 } 89 }
90} 90}
91 91
921; 921;
93 93

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines