6 use Config qw/%Config/;
11 $Config{useithreads} and eval "use threads; 1";
13 # Load Test::More after threads
17 plan(tests => 4 * 10);
19 plan(skip_all => 'This perl wasn\'t built to support threads');
23 use Linux::SysInfo qw/sysinfo/;
26 my $tid = threads->tid();
29 skip 'system error (sysinfo returned undef)' => 4 unless defined $si;
30 is ref($si), 'HASH', "sysinfo returns a hash reference in thread $tid";
33 if (defined $si->{uptime}) {
34 like $si->{uptime}, qr/^\d+(?:\.\d+)?$/,
35 "key $_ looks like a number in thread $tid";
37 fail "key $_ isn't defined in thread $tid";
43 my @t = map { threads->create(\&try, $_) } 1 .. 10;