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

Comparing Coro/Coro.pm (file contents):
Revision 1.14 by root, Tue Jul 17 02:21:56 2001 UTC vs.
Revision 1.17 by root, Thu Jul 19 02:45:09 2001 UTC

31 31
32use Coro::State; 32use Coro::State;
33 33
34use base Exporter; 34use base Exporter;
35 35
36$VERSION = 0.05; 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;
99 print STDERR "FATAL: deadlock detected\n"; 99 print STDERR "FATAL: deadlock detected\n";
100 exit(51); 100 exit(51);
101}; 101};
102 102
103# we really need priorities... 103# we really need priorities...
104## my @ready; #d#
105our @ready = (); # the ready queue. hehe, rather broken ;) 104my @ready; # the ready queue. hehe, rather broken ;)
106 105
107# static methods. not really. 106# static methods. not really.
108 107
109=head2 STATIC METHODS 108=head2 STATIC METHODS
110 109
221 220
222=cut 221=cut
223 222
2241; 2231;
225 224
226=head1 BUGS 225=head1 BUGS/LIMITATIONS
227 226
228 - could be faster, especially when the core would introduce special 227 - could be faster, especially when the core would introduce special
229 support for coroutines (like it does for threads). 228 support for coroutines (like it does for threads).
230 - 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
231 identify. Could be as small as a single SV. 230 identify. Could be as small as a single SV.
232 - 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).
233 238
234=head1 SEE ALSO 239=head1 SEE ALSO
235 240
236L<Coro::Channel>, L<Coro::Cont>, L<Coro::Specific>, L<Coro::Semaphore>, 241L<Coro::Channel>, L<Coro::Cont>, L<Coro::Specific>, L<Coro::Semaphore>,
237L<Coro::Signal>, L<Coro::State>, L<Coro::Event>. 242L<Coro::Signal>, L<Coro::State>, L<Coro::Event>.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines