source: trunk/essentials/dev-lang/perl/ext/Thread/create.tx

Last change on this file was 3181, checked in by bird, 18 years ago

perl 5.8.8

File size: 616 bytes
Line 
1BEGIN {
2 eval { require Config; import Config };
3 if ($@) {
4 print "1..0 # Skip: no Config\n";
5 exit(0);
6 }
7}
8
9use Thread 'async';
10use Config;
11use Tie::Hash;
12
13sub start_here {
14 my $i;
15 print "In start_here with args: @_\n";
16 for ($i = 1; $i <= 5; $i++) {
17 print "start_here: $i\n";
18 sleep 1;
19 }
20}
21
22async {
23 tie my(%h), 'Tie::StdHash';
24 %h = %Config;
25 print "running on $h{archname}\n";
26};
27
28print "Starting new thread now\n";
29$t = new Thread \&start_here, qw(foo bar baz);
30print "Started thread $t\n";
31for ($count = 1; $count <= 5; $count++) {
32 print "main: $count\n";
33 sleep 1;
34}
Note: See TracBrowser for help on using the repository browser.