ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/t/20_mutual_cancel.t
Revision: 1.1
Committed: Fri Apr 29 17:38:56 2011 UTC (13 years, 1 month ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-6_512, rel-6_513, rel-6_511, rel-6_09, rel-6_514, rel-6_0, rel-6_5, rel-6_32, rel-6_33, rel-6_31, rel-6_36, rel-6_37, rel-6_38, rel-6_39, rel-6_10, rel-6_51, rel-6_52, rel-6_53, rel-6_54, rel-6_55, rel-6_56, rel-6_57, rel-6_03, rel-6_02, rel-6_23, rel-6_08, rel-6_07, rel-6_06, rel-6_05, rel-6_04, rel-6_29, rel-6_28, rel-6_01, rel-6_43, rel-6_42, rel-6_41, rel-6_47, rel-6_46, rel-6_45, rel-6_44, rel-6_49, rel-6_48, HEAD
Log Message:
*** empty log message ***

File Contents

# Content
1 $|=1;
2 print "1..10\n";
3
4 # when two coros cancel each other mutually,
5 # the slf function currently being executed needs to
6 # be cleaned up, otherwise the next slf call in the cleanup code
7 # will simply resume the previous call.
8 # in addition, mutual cancellation must be specially handled
9 # as currently, we sometimes cancel coros from another coro
10 # which must not be interrupted (see slf_init_cancel).
11
12 use Coro;
13
14 print "ok 1\n";
15
16 my ($a, $b);
17
18 sub xyz::DESTROY {
19 print "ok 7\n";
20 $b->cancel;
21 print "ok 8\n";
22 }
23
24 $b = async {
25 print "ok 3\n";
26 cede;
27 print "ok 6\n";
28 $a->cancel;
29 print "not ok 7\n";
30 };
31
32 $a = async {
33 print "ok 4\n";
34 my $x = bless \my $dummy, "xyz";
35 cede;
36 print "not ok 5\n";
37 };
38
39 print "ok 2\n";
40 cede;
41 print "ok 5\n";
42 cede;
43 print "ok 9\n";
44 cede;
45 print "ok 10\n";
46