ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/63_eventlib_02_signals.t
Revision: 1.1
Committed: Wed Jul 8 05:30:55 2009 UTC (15 years, 5 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-4_82, rel-4_83, rel-4_81
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::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