1 package Linux::SysInfo::TestThreads;
6 use Config qw<%Config>;
12 Test::More::diag($_) for @_;
18 my $force = $ENV{PERL_LINUX_SYSINFO_TEST_THREADS} ? 1 : !1;
19 skip_all 'This perl wasn\'t built to support threads'
20 unless $Config{useithreads};
21 skip_all 'perl 5.13.4 required to test thread safety'
22 unless $force or "$]" >= 5.013_004;
24 load_or_skip_all('threads', $force ? '0' : '1.67', [ ]);
31 while (my ($name, $code) = each %exports) {
33 *{$pkg.'::'.$name} = $code;
41 local $SIG{__WARN__} = sub { push @diag, "Thread creation warning: @_" };
44 push @diag, "Thread creation error: $@" if $@;
46 return $thread ? $thread : ();