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

Comparing Coro/Coro.pm (file contents):
Revision 1.37 by root, Mon Sep 24 02:25:44 2001 UTC vs.
Revision 1.38 by root, Wed Oct 3 01:09:56 2001 UTC

38 38
39use Coro::State; 39use Coro::State;
40 40
41use base Exporter; 41use base Exporter;
42 42
43$VERSION = 0.5; 43$VERSION = 0.51;
44 44
45@EXPORT = qw(async cede schedule terminate current); 45@EXPORT = qw(async cede schedule terminate current);
46%EXPORT_TAGS = ( 46%EXPORT_TAGS = (
47 prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)], 47 prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)],
48); 48);
116}; 116};
117 117
118# this coroutine is necessary because a coroutine 118# this coroutine is necessary because a coroutine
119# cannot destroy itself. 119# cannot destroy itself.
120my @destroy; 120my @destroy;
121my $manager;
121my $manager = new Coro sub { 122$manager = new Coro sub {
122 while() { 123 while() {
123 # by overwriting the state object with the manager we destroy it 124 # by overwriting the state object with the manager we destroy it
124 # while still being able to schedule this coroutine (in case it has 125 # while still being able to schedule this coroutine (in case it has
125 # been readied multiple times. this is harmless since the manager 126 # been readied multiple times. this is harmless since the manager
126 # can be called as many times as neccessary and will always 127 # can be called as many times as neccessary and will always

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines