use Exporter ();
+my $main_process;
+
BEGIN {
+ $main_process = $$;
+
if ($] >= 5.008 and $INC{'threads.pm'}) {
my $use_ithreads = do {
require Config;
}
END {
- unless ($?) {
+ if ($main_process == $$ and not $?) {
lock $plan if THREADSAFE;
if (defined $plan) {