~ubuntu-branches/ubuntu/trusty/torrus/trusty-proposed

« back to all changes in this revision

Viewing changes to setup_tools/check_perlthreading.pl

  • Committer: Bazaar Package Importer
  • Author(s): Marc Haber
  • Date: 2008-03-08 00:18:46 UTC
  • mfrom: (1.2.1 upstream) (3.1.3 hardy)
  • Revision ID: james.westby@ubuntu.com-20080308001846-q3pinwcswe3uf7wj
Tags: 1.0.6-2
Add torrus-common.NEWS advising people to recompile their
configuration upon upgrading to torrus 1.0.6.
Thanks to Joerg Dorchain. Closes: #469274

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
use threads;
 
3
 
 
4
$| = 1;
 
5
 
 
6
print "The child thread must keep ticking while the main thread sleeps\n";
 
7
print "If it's not so, then we have a compatibility problem\n";
 
8
 
 
9
 
 
10
 
 
11
my $thrChild = threads->create( \&child );
 
12
$thrChild->detach();
 
13
 
 
14
print "P> Launched the child thread. Now I sleep 20 seconds\n";
 
15
sleep(20);
 
16
print "P> Parent woke up. Was there ticking inbetween?\n";
 
17
 
 
18
exit 0;
 
19
 
 
20
 
 
21
 
 
22
sub child
 
23
{
 
24
    print "C> Child thread started. I will print 10 lines, one per second\n";
 
25
 
 
26
    foreach my $i (1..10)
 
27
    {
 
28
        print("C> Child tick " . $i . "\n");
 
29
        sleep(1);
 
30
    }
 
31
}
 
32
 
 
33
        
 
34
            
 
35
        
 
36
    
 
37