ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/t/11_deadlock.t
Revision: 1.3
Committed: Mon Nov 24 06:48:38 2008 UTC (15 years, 6 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-5_151, rel-5_1, rel-6_0, rel-6_10, rel-6_13, rel-6_09, rel-6_08, rel-6_07, rel-6_06, rel-6_05, rel-6_04, rel-6_03, rel-6_02, rel-6_01, rel-5_161, rel-5_371, rel-5_372, rel-5_22, rel-5_23, rel-5_24, rel-5_25, rel-5_162, rel-5_2, rel-5_37, rel-5_36, rel-6_23, rel-5_11, rel-5_12, rel-5_15, rel-5_14, rel-5_17, rel-5_16, rel-5_132, rel-5_131
Changes since 1.2: +9 -0 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 BEGIN {
2 if ($^O =~ /mswin32/i) {
3 print <<EOF;
4 1..0 # Perl binary broken, skipping test. Upgrading to a working perl is advised.
5 EOF
6 exit 0;
7 }
8 }
9
10 BEGIN { $| = 1; print "1..5\n"; }
11
12 use Coro;
13
14 print "ok 1\n";
15
16 my $pid = fork or do {
17 my $old_idle = $Coro::idle;
18 $Coro::idle = sub {
19 print "ok 2\n";
20 close STDERR;
21 close STDOUT;
22 $old_idle->();
23 };
24 schedule;
25 exit 3;
26 };
27
28 waitpid $pid, 0;
29 print
30 3 == $? >> 8
31 ? "not " : "", "ok 3\n";
32
33 my $coro = new Coro sub {
34 print "ok 5\n";
35 Coro::State::_exit 0;
36 };
37
38 $Coro::idle = sub {
39 $coro->ready;
40 };
41
42 print "ok 4\n";
43
44 schedule;
45 die;