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

Comparing Coro/Coro.pm (file contents):
Revision 1.2 by root, Tue Jul 3 03:40:07 2001 UTC vs.
Revision 1.5 by root, Tue Jul 10 01:43:21 2001 UTC

1=head1 NAME 1=head1 NAME
2 2
3Coro - create an manage coroutines 3Coro - create and manage coroutines
4 4
5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7 use Coro; 7 use Coro;
8 8
35=cut 35=cut
36 36
37package Coro; 37package Coro;
38 38
39BEGIN { 39BEGIN {
40 $VERSION = 0.01; 40 $VERSION = 0.03;
41 41
42 require XSLoader; 42 require XSLoader;
43 XSLoader::load Coro, $VERSION; 43 XSLoader::load Coro, $VERSION;
44} 44}
45 45
90 eval { &$proc->resume }; 90 eval { &$proc->resume };
91 if ($@) { 91 if ($@) {
92 ($error_msg, $error_coro) = ($@, $current); 92 ($error_msg, $error_coro) = ($@, $current);
93 $error->resume; 93 $error->resume;
94 } 94 }
95 } while (); 95 } while (1);
96 }, $class; 96 }, $class;
97} 97}
98 98
99=item $coro->resume 99=item $coro->resume
100 100
102 102
103=cut 103=cut
104 104
105my $prev; 105my $prev;
106 106
107# I call the _transfer function from a pelr function
108# because that way perl saves all important things on
109# the stack.
107sub resume { 110sub resume {
108 $prev = $current; $current = $_[0]; 111 $prev = $current; $current = $_[0];
109 _transfer($prev, $current); 112 _transfer($prev, $current);
110} 113}
111 114

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines