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

Comparing Coro/Coro.pm (file contents):
Revision 1.297 by root, Thu May 12 23:55:39 2011 UTC vs.
Revision 1.301 by root, Sun Jul 3 10:51:40 2011 UTC

16 cede; # yield to coro 16 cede; # yield to coro
17 print "3\n"; 17 print "3\n";
18 cede; # and again 18 cede; # and again
19 19
20 # use locking 20 # use locking
21 use Coro::Semaphore;
22 my $lock = new Coro::Semaphore; 21 my $lock = new Coro::Semaphore;
23 my $locked; 22 my $locked;
24 23
25 $lock->down; 24 $lock->down;
26 $locked = 1; 25 $locked = 1;
343 342
344our $idle; # idle handler 343our $idle; # idle handler
345our $main; # main coro 344our $main; # main coro
346our $current; # current coro 345our $current; # current coro
347 346
348our $VERSION = 5.372; 347our $VERSION = 6.01;
349 348
350our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub rouse_cb rouse_wait); 349our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub rouse_cb rouse_wait);
351our %EXPORT_TAGS = ( 350our %EXPORT_TAGS = (
352 prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)], 351 prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)],
353); 352);
767current Coro. 766current Coro.
768 767
769This is a rather brutal way to free a coro, with some limitations - if 768This is a rather brutal way to free a coro, with some limitations - if
770the thread is inside a C callback that doesn't expect to be canceled, 769the thread is inside a C callback that doesn't expect to be canceled,
771bad things can happen, or if the cancelled thread insists on running 770bad things can happen, or if the cancelled thread insists on running
772complicated cleanup handlers that rely on it'S thread context, things will 771complicated cleanup handlers that rely on its thread context, things will
773not work. 772not work.
774 773
775Any cleanup code being run (e.g. from C<guard> blocks) will be run without 774Any cleanup code being run (e.g. from C<guard> blocks) will be run without
776a thread context, and is not allowed to switch to other threads. On the 775a thread context, and is not allowed to switch to other threads. On the
777plus side, C<< ->cancel >> will always clean up the thread, no matter 776plus side, C<< ->cancel >> will always clean up the thread, no matter

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines