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