Rename the old non-standard threads tests so that
[p5sagit/p5-mst-13.2.git] / ext / Thread / create.tx
1 BEGIN {
2     eval { require Config; import Config };
3     if ($@) {
4         print "1..0 # Skip: no Config\n";
5         exit(0);
6     }
7     if ($Config{extensions} !~ /\bThread\b/) {
8         print "1..0 # Skip: no use5005threads\n";
9         exit(0);
10     }
11 }
12
13 use Thread 'async';
14 use Config;
15 use Tie::Hash;
16
17 sub start_here {
18     my $i;
19     print "In start_here with args: @_\n";
20     for ($i = 1; $i <= 5; $i++) {
21         print "start_here: $i\n";
22         sleep 1;
23     }
24 }
25
26 async {
27     tie my(%h), 'Tie::StdHash';
28     %h = %Config;
29     print "running on $h{archname}\n";
30 };
31
32 print "Starting new thread now\n";
33 $t = new Thread \&start_here, qw(foo bar baz);
34 print "Started thread $t\n";
35 for ($count = 1; $count <= 5; $count++) {
36     print "main: $count\n";
37     sleep 1;
38 }