use strict;
use warnings;
-use Config qw/%Config/;
+use lib 't/lib';
+use Linux::SysInfo::TestThreads;
-BEGIN {
- if (!$Config{useithreads}) {
- require Test::More;
- Test::More->import;
- plan(skip_all => 'This perl wasn\'t built to support threads');
- }
-}
-
-use threads;
+use Test::More 'no_plan';
-use Test::More tests => 4 * 10;
-
-use Linux::SysInfo qw/sysinfo/;
+use Linux::SysInfo qw<sysinfo>;
sub try {
my $tid = threads->tid();
}
}
-my @t = map { threads->create(\&try, $_) } 1 .. 10;
-$_->join for @t;
+my @threads = map spawn(\&try, $_), 1 .. 10;
+
+$_->join for @threads;
+
+pass 'done';