ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/68_poe_02_signals.t
Revision: 1.2
Committed: Thu Apr 23 22:44:30 2009 UTC (15 years, 1 month ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-4_4, rel-4_45, rel-4_41, rel-4_42, rel-4_412, rel-4_81, rel-4_411, rel-4_8
Changes since 1.1: +1 -0 lines
Log Message:
*** empty log message ***

File Contents

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