Commit | Line | Data |
---|---|---|
0fcb073c JH |
1 | BEGIN { |
2 | eval { require Config; import Config }; | |
3 | if ($@) { | |
4 | print "1..0 # Skip: no Config\n"; | |
5 | exit(0); | |
6 | } | |
0fcb073c JH |
7 | } |
8 | ||
0a3e5ca2 GS |
9 | use Thread 'async'; |
10 | use Config; | |
11 | use Tie::Hash; | |
12 | ||
d9bb3666 MB |
13 | sub 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 GS |
22 | async { |
23 | tie my(%h), 'Tie::StdHash'; | |
24 | %h = %Config; | |
25 | print "running on $h{archname}\n"; | |
26 | }; | |
27 | ||
d9bb3666 MB |
28 | print "Starting new thread now\n"; |
29 | $t = new Thread \&start_here, qw(foo bar baz); | |
30 | print "Started thread $t\n"; | |
31 | for ($count = 1; $count <= 5; $count++) { | |
32 | print "main: $count\n"; | |
33 | sleep 1; | |
34 | } |