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

Comparing Coro/Coro.pm (file contents):
Revision 1.20 by root, Sat Jul 21 18:21:45 2001 UTC vs.
Revision 1.21 by root, Sun Jul 22 03:24:10 2001 UTC

27 27
28In this module, coroutines are defined as "callchain + lexical variables 28In this module, coroutines are defined as "callchain + lexical variables
29+ @_ + $_ + $@ + $^W), that is, a coroutine has it's own callchain, it's 29+ @_ + $_ + $@ + $^W), that is, a coroutine has it's own callchain, it's
30own set of lexicals and it's own set of perl's most important global 30own set of lexicals and it's own set of perl's most important global
31variables. 31variables.
32
33WARNING: When using this module, make sure that, at program end, no
34coroutines are still running OR just call exit before falling off the
35end. The reason for this is that some coroutine of yours might have called
36into a C function, and falling off the end of main:: results in returning
37to that C function instead if to the main C interpreter.
32 38
33=cut 39=cut
34 40
35package Coro; 41package Coro;
36 42
174 180
175=cut 181=cut
176 182
177sub terminate { 183sub terminate {
178 $current->{_results} = [@_]; 184 $current->{_results} = [@_];
185 delete $current->{_coro_state};
179 &schedule; 186 &schedule;
180} 187}
181 188
182=back 189=back
183 190

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines