… | |
… | |
38 | #my $timer = AnyEvent->timer (after => 2, cb => sub { }); |
38 | #my $timer = AnyEvent->timer (after => 2, cb => sub { }); |
39 | |
39 | |
40 | my $cv = AnyEvent->condvar; |
40 | my $cv = AnyEvent->condvar; |
41 | |
41 | |
42 | unless ($pid) { |
42 | unless ($pid) { |
43 | print "ok ${it}2\n"; |
43 | print "ok ${it}2 # child $$\n"; |
44 | POSIX::_exit 3; |
44 | POSIX::_exit 3; |
45 | } |
45 | } |
46 | |
|
|
47 | my $w = AnyEvent->child (pid => $pid, cb => sub { |
46 | my $w = AnyEvent->child (pid => $pid, cb => sub { |
48 | print $pid == $_[0] ? "" : "not ", "ok ${it}3\ # $pid == $_[0]\n"; |
47 | print $pid == $_[0] ? "" : "not ", "ok ${it}3\ # $pid == $_[0]\n"; |
49 | print 3 == ($_[1] >> 8) ? "" : "not ", "ok ${it}4 # 3 == $_[1] >> 8 ($_[1])\n"; |
48 | print 3 == ($_[1] >> 8) ? "" : "not ", "ok ${it}4 # 3 == $_[1] >> 8 ($_[1])\n"; |
50 | $cv->broadcast; |
49 | $cv->broadcast; |
51 | }); |
50 | }); |