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

Comparing Coro/Coro.pm (file contents):
Revision 1.26 by root, Fri Jul 27 02:51:33 2001 UTC vs.
Revision 1.29 by root, Sat Aug 11 00:37:31 2001 UTC

36 36
37use Coro::State; 37use Coro::State;
38 38
39use base Exporter; 39use base Exporter;
40 40
41$VERSION = 0.12; 41$VERSION = 0.45;
42 42
43@EXPORT = qw(async cede schedule terminate current); 43@EXPORT = qw(async cede schedule terminate current);
44@EXPORT_OK = qw($current); 44@EXPORT_OK = qw($current);
45 45
46{ 46{
190Future versions of this function will allow result arguments. 190Future versions of this function will allow result arguments.
191 191
192=cut 192=cut
193 193
194sub terminate { 194sub terminate {
195 push @destroy, $current; 195 $current->cancel;
196 $manager->ready;
197 &schedule; 196 &schedule;
198 # NORETURN 197 die; # NORETURN
199} 198}
200 199
201=back 200=back
202 201
203# dynamic methods 202# dynamic methods
236 235
237=cut 236=cut
238 237
239sub ready { 238sub ready {
240 push @ready, $_[0]; 239 push @ready, $_[0];
240}
241
242=item $process->cancel
243
244Like C<terminate>, but terminates the specified process instead.
245
246=cut
247
248sub cancel {
249 push @destroy, $_[0];
250 $manager->ready;
241} 251}
242 252
243=back 253=back
244 254
245=cut 255=cut

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines