1 |
$|=1; |
2 |
BEGIN { |
3 |
print "1..5\n"; |
4 |
} |
5 |
|
6 |
use AnyEvent; |
7 |
use AnyEvent::Impl::EventLib; |
8 |
|
9 |
print "ok 1\n"; |
10 |
|
11 |
my $cv = AnyEvent->condvar; |
12 |
|
13 |
my $error = AnyEvent->timer (after => 5, cb => sub { |
14 |
print <<EOF; |
15 |
Bail out! No signal caught. |
16 |
EOF |
17 |
exit 0; |
18 |
}); |
19 |
|
20 |
my $sw = AnyEvent->signal (signal => 'INT', cb => sub { |
21 |
print "ok 3\n"; |
22 |
$cv->broadcast; |
23 |
}); |
24 |
|
25 |
print "ok 2\n"; |
26 |
kill 'INT', $$; |
27 |
$cv->wait; |
28 |
undef $error; |
29 |
|
30 |
print "ok 4\n"; |
31 |
|
32 |
undef $sw; |
33 |
|
34 |
print "ok 5\n"; |
35 |
|