ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/02_signals.t
Revision: 1.5
Committed: Fri May 23 16:36:02 2008 UTC (16 years, 1 month ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-4_151, rel-4_152, rel-4_04, rel-4_23, rel-4_21, rel-4_412, rel-4_81, rel-4_83, rel-4_82, rel-4_352, rel-4_351, rel-4_14, rel-4_15, rel-4_13, rel-4_331, rel-4_231, rel-4_233, rel-4_232, rel-4_8, rel-4_234, rel-4_4, rel-4_0, rel-4_05, rel-4_12, rel-4_11, rel-4_22, rel-4_161, rel-4_160, rel-4_411, rel-4_45, rel-4_41, rel-4_42, rel-4_1, rel-4_2, rel-4_3, rel-4_31, rel-4_32, rel-4_33, rel-4_34, rel-4_35, rel-4_03
Changes since 1.4: +0 -10 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 $|=1;
2 root 1.4 BEGIN {
3     print "1..5\n";
4     }
5 root 1.1
6     use AnyEvent;
7 root 1.3 use AnyEvent::Impl::Perl;
8 root 1.1
9     print "ok 1\n";
10    
11     my $cv = AnyEvent->condvar;
12    
13 root 1.4 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 root 1.1 print "ok 3\n";
22     $cv->broadcast;
23     });
24    
25     print "ok 2\n";
26 root 1.4 kill 'INT', $$;
27 root 1.1 $cv->wait;
28 root 1.4 undef $error;
29 root 1.1
30 root 1.2 print "ok 4\n";
31    
32 root 1.1 undef $sw;
33    
34 root 1.2 print "ok 5\n";
35 root 1.1