ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/66_ioasync_02_signals.t
Revision: 1.1
Committed: Thu Jun 25 11:16:08 2009 UTC (15 years ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-4_45, rel-4_42, rel-4_81, rel-4_8
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 $|=1;
2     BEGIN {
3     print "1..5\n";
4     }
5    
6     use AnyEvent;
7     use AnyEvent::Impl::IOAsync;
8     use IO::Async::Loop; AnyEvent::Impl::IOAsync::set_loop new IO::Async::Loop;
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