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

Comparing Coro/Coro.pm (file contents):
Revision 1.93 by root, Fri Dec 1 19:41:06 2006 UTC vs.
Revision 1.95 by root, Sun Dec 3 22:50:06 2006 UTC

41 41
42our $idle; # idle handler 42our $idle; # idle handler
43our $main; # main coroutine 43our $main; # main coroutine
44our $current; # current coroutine 44our $current; # current coroutine
45 45
46our $VERSION = '3.0'; 46our $VERSION = '3.01';
47 47
48our @EXPORT = qw(async cede schedule terminate current unblock_sub); 48our @EXPORT = qw(async cede schedule terminate current unblock_sub);
49our %EXPORT_TAGS = ( 49our %EXPORT_TAGS = (
50 prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)], 50 prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)],
51); 51);
254 254
255Calling C<exit> in a coroutine will not work correctly, so do not do that. 255Calling C<exit> in a coroutine will not work correctly, so do not do that.
256 256
257=cut 257=cut
258 258
259sub _new_coro { 259sub _run_coro {
260 terminate &{+shift}; 260 terminate &{+shift};
261} 261}
262 262
263sub new { 263sub new {
264 my $class = shift; 264 my $class = shift;
265 265
266 $class->SUPER::new (\&_new_coro, @_) 266 $class->SUPER::new (\&_run_coro, @_)
267} 267}
268 268
269=item $success = $coroutine->ready 269=item $success = $coroutine->ready
270 270
271Put the given coroutine into the ready queue (according to it's priority) 271Put the given coroutine into the ready queue (according to it's priority)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines