default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / torrus / setup_tools / check_perlthreading.pl
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