This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
dist/threads/t/libc.t: Add timer to avoid deadlock
[perl5.git] / dist / threads / t / libc.t
index 4f6f6ed..6595894 100644 (file)
@@ -9,6 +9,12 @@ BEGIN {
         skip_all(q/Perl not compiled with 'useithreads'/);
     }
 
+    my $time_out_factor = $ENV{PERL_TEST_TIME_OUT_FACTOR} || 1;
+    $time_out_factor = 1 if $time_out_factor < 1;
+
+    # Guard against bugs that result in deadlock
+    watchdog(1 * 60 * $time_out_factor);
+
     plan(11);
 }