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.39 by root, Tue Oct 9 00:39:08 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
223 }, $class; 224 }, $class;
224} 225}
225 226
226=item $process->ready 227=item $process->ready
227 228
228Put the current process into the ready queue. 229Put the given process into the ready queue.
229 230
230=cut 231=cut
231 232
232=item $process->cancel 233=item $process->cancel
233 234

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines