ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/68_poe_02_signals.t
Revision: 1.1
Committed: Thu Oct 2 08:43:58 2008 UTC (15 years, 9 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-4_35, rel-4_352, rel-4_31, rel-4_32, rel-4_34, rel-4_3, rel-4_33, rel-4_351, rel-4_331
Log Message:
*** empty log message ***

File Contents

# Content
1 $|=1;
2 BEGIN {
3 print "1..5\n";
4 }
5
6 use AnyEvent;
7 use AnyEvent::Impl::POE;
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