ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/Async-Interrupt/t/05_var.t
Revision: 1.1
Committed: Fri Jul 17 01:51:32 2009 UTC (17 years, 2 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-1_1, rel-1_0, rel-0_501, rel-1_2, rel-1_02, rel-1_03, rel-1_01, rel-0_5, rel-1_04, rel-1_05, rel-1_24, rel-1_25, rel-1_26, rel-0_06, rel-1_21, rel-1_22, rel-1_23, HEAD
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 print "1..7\n"; $|=1;
2    
3     use Async::Interrupt;
4    
5     my $var;
6    
7     my $ai = new Async::Interrupt
8     var => \$var,
9     cb => sub { print $var ? "not " : "", "ok $_[0]\n" };
10    
11     print $$ai ? "" : "not ", "ok 1 # $$ai\n";
12    
13     print $ai->c_var ? "" : "not ", "ok 2\n";
14    
15     $ai->signal (3);
16    
17     print $var == 0 ? "" : "not ", "ok 4\n";
18    
19     $ai->block;
20     $ai->signal (7);
21    
22     print "ok 5\n";
23    
24     print $var == 7 ? "" : "not ", "ok 6\n";
25    
26     $ai->unblock;
27