… | |
… | |
56 | |
56 | |
57 | use XSLoader; |
57 | use XSLoader; |
58 | |
58 | |
59 | use base Exporter::; |
59 | use base Exporter::; |
60 | |
60 | |
61 | our @EXPORT = qw(loop unloop sweep reschedule); |
61 | our @EXPORT = qw(loop unloop sweep); |
62 | |
62 | |
63 | BEGIN { |
63 | BEGIN { |
64 | our $VERSION = 1.9; |
64 | our $VERSION = 1.9; |
65 | |
65 | |
66 | local $^W = 0; # avoid redefine warning for Coro::ready; |
66 | local $^W = 0; # avoid redefine warning for Coro::ready; |
… | |
… | |
123 | } |
123 | } |
124 | |
124 | |
125 | # double calls to avoid stack-cloning ;() |
125 | # double calls to avoid stack-cloning ;() |
126 | # is about 10% slower, though. |
126 | # is about 10% slower, though. |
127 | sub next($) { |
127 | sub next($) { |
128 | &Coro::schedule if &_next; $_[0]; |
128 | &Coro::schedule while &_next; |
|
|
129 | |
|
|
130 | $_[0] |
129 | } |
131 | } |
130 | |
132 | |
131 | sub Coro::Event::w { $_[0] } |
133 | sub Coro::Event::w { $_[0] } |
132 | sub Coro::Event::prio { $_[0]{Coro::Event}[3] } |
134 | sub Coro::Event::prio { $_[0]{Coro::Event}[3] } |
133 | sub Coro::Event::hits { $_[0]{Coro::Event}[4] } |
135 | sub Coro::Event::hits { $_[0]{Coro::Event}[4] } |