All the authors of these modules have now been contacted;
[p5sagit/p5-mst-13.2.git] / ext / Thread / create.tx
CommitLineData
0fcb073c 1BEGIN {
2 eval { require Config; import Config };
3 if ($@) {
4 print "1..0 # Skip: no Config\n";
5 exit(0);
6 }
0fcb073c 7}
8
0a3e5ca2 9use Thread 'async';
10use Config;
11use Tie::Hash;
12
d9bb3666 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
0a3e5ca2 22async {
23 tie my(%h), 'Tie::StdHash';
24 %h = %Config;
25 print "running on $h{archname}\n";
26};
27
d9bb3666 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}