3 unless ($Config{useithreads}) {
4 print "1..0 # SKIP your perl does not support ithreads\n";
15 use Time::HiRes 'sleep';
18 $|++; # seems to be critical
22 # older perls crash if threads are spawned way too quickly, sleep for 100 msecs
23 my @pool = map { sleep 0.1 and threads->create(\&run_torture) } (1..($ENV{AUTOMATED_TESTING} ? 20 : 5) );
25 # again - necessary for older perls
30 die ($_->can('error') ? $_->error : "Thread did not finish successfully" );
34 if ($ENV{AUTOMATED_TESTING}) {
36 if (-f "/proc/$$/stat") {
37 my $proc_stat = do { local (@ARGV, $/) = "/proc/$$/stat"; <> };
38 ($vsz) = map { $_ / 1024 }
39 (split (/\s+/, $proc_stat))[-22]; # go backwards because the %s of the procname can contain anything
42 printf STDERR "#\n# VSIZE:%dKiB\n", $vsz
46 print "1..$::TEST_COUNT\n";
49 do( ( "@{[ getcwd() ]}/t/03torture.t" =~ /^(.*)$/ )[0] );