… | |
… | |
31 | |
31 | |
32 | use Coro::State; |
32 | use Coro::State; |
33 | |
33 | |
34 | use base Exporter; |
34 | use base Exporter; |
35 | |
35 | |
36 | $VERSION = 0.07; |
36 | $VERSION = 0.08; |
37 | |
37 | |
38 | @EXPORT = qw(async yield schedule terminate); |
38 | @EXPORT = qw(async yield schedule terminate); |
39 | @EXPORT_OK = qw($current); |
39 | @EXPORT_OK = qw($current); |
40 | |
40 | |
41 | { |
41 | { |
… | |
… | |
52 | my @attrs; |
52 | my @attrs; |
53 | for (@_) { |
53 | for (@_) { |
54 | if ($_ eq "Coro") { |
54 | if ($_ eq "Coro") { |
55 | push @async, $ref; |
55 | push @async, $ref; |
56 | } else { |
56 | } else { |
57 | push @attrs, @_; |
57 | push @attrs, $_; |
58 | } |
58 | } |
59 | } |
59 | } |
60 | return $old ? $old->($package, $name, @attrs) : @attrs; |
60 | return $old ? $old->($package, $ref, @attrs) : @attrs; |
61 | }; |
61 | }; |
62 | } |
62 | } |
63 | |
63 | |
64 | sub INIT { |
64 | sub INIT { |
65 | async pop @async while @async; |
65 | async pop @async while @async; |
… | |
… | |
220 | |
220 | |
221 | =cut |
221 | =cut |
222 | |
222 | |
223 | 1; |
223 | 1; |
224 | |
224 | |
225 | =head1 BUGS |
225 | =head1 BUGS/LIMITATIONS |
226 | |
226 | |
227 | - could be faster, especially when the core would introduce special |
227 | - could be faster, especially when the core would introduce special |
228 | support for coroutines (like it does for threads). |
228 | support for coroutines (like it does for threads). |
229 | - there is still a memleak on coroutine termination that I could not |
229 | - there is still a memleak on coroutine termination that I could not |
230 | identify. Could be as small as a single SV. |
230 | identify. Could be as small as a single SV. |
231 | - this module is not well-tested. |
231 | - this module is not well-tested. |
|
|
232 | - if variables or arguments "disappear" (become undef) or become |
|
|
233 | corrupted please contact the author so he cen iron out the |
|
|
234 | remaining bugs. |
|
|
235 | - this module is not thread-safe. You must only ever use this module from |
|
|
236 | the same thread (this requirement might be loosened in the future to |
|
|
237 | allow per-thread schedulers, but Coro::Satte does not yet allow this). |
232 | |
238 | |
233 | =head1 SEE ALSO |
239 | =head1 SEE ALSO |
234 | |
240 | |
235 | L<Coro::Channel>, L<Coro::Cont>, L<Coro::Specific>, L<Coro::Semaphore>, |
241 | L<Coro::Channel>, L<Coro::Cont>, L<Coro::Specific>, L<Coro::Semaphore>, |
236 | L<Coro::Signal>, L<Coro::State>, L<Coro::Event>. |
242 | L<Coro::Signal>, L<Coro::State>, L<Coro::Event>. |