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

Comparing Coro/Event/Event.pm (file contents):
Revision 1.43 by root, Fri Dec 1 19:41:06 2006 UTC vs.
Revision 1.44 by root, Fri Dec 1 20:49:54 2006 UTC

129 bless $w, $class 129 bless $w, $class
130 }; 130 };
131 *{ $flavour } = $coronew; 131 *{ $flavour } = $coronew;
132 *{"do_$flavour"} = sub { 132 *{"do_$flavour"} = sub {
133 unshift @_, Coro::Event::; 133 unshift @_, Coro::Event::;
134 my $e = &$coronew->next; 134 @_ = &$coronew;
135 $e->cancel; # $e === $e->w 135 &Coro::schedule while &_next;
136 $e 136 $_[0]->cancel;
137 &_event
137 }; 138 };
138} 139}
139 140
140# do schedule in perl to avoid forcign a stack allocation. 141# do schedule in perl to avoid forcing a stack allocation.
141# this is about 10% slower, though. 142# this is about 10% slower, though.
142sub next($) { 143sub next($) {
143 &Coro::schedule while &_next; 144 &Coro::schedule while &_next;
144 145
145 $_[0] 146 &_event
146} 147}
147 148
148sub Coro::Event::w { $_[0] } 149sub Coro::Event::w { $_[0] }
149sub Coro::Event::prio { $_[0]{Coro::Event}[3] } 150sub Coro::Event::prio { $_[0]{Coro::Event}[3] }
150sub Coro::Event::hits { $_[0]{Coro::Event}[4] } 151sub Coro::Event::hits { $_[0]{Coro::Event}[4] }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines