3 unless ($Config{useithreads}) {
4 print "1..0 # SKIP your perl does not support ithreads\n";
15 use Time::HiRes 'sleep';
17 $|++; # seems to be critical
21 # older perls crash if threads are spawned way too quickly, sleep for 100 msecs
22 my @pool = map { sleep 0.1 and threads->create(\&run_torture) } (1..10);
25 if ($ENV{AUTOMATED_TESTING}) {
27 if (-f "/proc/$$/stat") {
28 my $proc_stat = do { local (@ARGV, $/) = "/proc/$$/stat"; <> };
29 ($vsz) = map { $_ / 1024 }
30 (split (/\s+/, $proc_stat))[-22]; # go backwards because the %s of the procname can contain anything
33 printf STDERR "#\n# VSIZE:%dKiB\n", $vsz
37 print "1..$::TEST_COUNT\n";
40 my $src = do { local (@ARGV, $/) = 't/03torture.t'; <>; };