]> git.vpit.fr Git - perl/modules/Test-Leaner.git/blobdiff - lib/Test/Leaner.pm
Only run the END block in the main process
[perl/modules/Test-Leaner.git] / lib / Test / Leaner.pm
index 896582b187982b63bf3659f780e5ee5af2931b6e..3881656a12072c805d26a254e09d5de8d38b1069 100644 (file)
@@ -72,7 +72,11 @@ C<use_ok>, C<require_ok>, C<can_ok>, C<isa_ok>, C<new_ok>, C<subtest>, C<explain
 
 use Exporter ();
 
+my $main_process;
+
 BEGIN {
+ $main_process = $$;
+
  if ($] >= 5.008 and $INC{'threads.pm'}) {
   my $use_ithreads = do {
    require Config;
@@ -759,7 +763,7 @@ sub BAIL_OUT {
 }
 
 END {
unless ($?) {
if ($main_process == $$ and not $?) {
   lock $plan if THREADSAFE;
 
   if (defined $plan) {