This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add socklen_t probe; Configure maintenance.
[perl5.git] / ext / Thread / create.t
CommitLineData
0a3e5ca2
GS
1use Thread 'async';
2use Config;
3use Tie::Hash;
4
d9bb3666
MB
5sub start_here {
6 my $i;
7 print "In start_here with args: @_\n";
8 for ($i = 1; $i <= 5; $i++) {
9 print "start_here: $i\n";
10 sleep 1;
11 }
12}
13
0a3e5ca2
GS
14async {
15 tie my(%h), 'Tie::StdHash';
16 %h = %Config;
17 print "running on $h{archname}\n";
18};
19
d9bb3666
MB
20print "Starting new thread now\n";
21$t = new Thread \&start_here, qw(foo bar baz);
22print "Started thread $t\n";
23for ($count = 1; $count <= 5; $count++) {
24 print "main: $count\n";
25 sleep 1;
26}