Fix warning when THREADS env var is missing

This commit is contained in:
Robert Lanyi 2020-03-22 14:59:37 +01:00
parent 858c646e01
commit a0ffd9d867

View File

@ -43,7 +43,7 @@ $|=1;
my $i :shared = 0; my $i :shared = 0;
my $num_workers = 1; my $num_workers = 1;
if (($ENV{'THREADS'} =~ /^\d+$/) and ($ENV{'THREADS'} > 0)) { if (($ENV{'THREADS'}) and ($ENV{'THREADS'} =~ /^\d+$/) and ($ENV{'THREADS'} > 0)) {
$num_workers = $ENV{'THREADS'}; $num_workers = $ENV{'THREADS'};
} }
print("Using " . $num_workers . " threads.\n"); print("Using " . $num_workers . " threads.\n");