This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
don't depend on threads to do a watchdog when testing threads
authorTony Cook <tony@develop-help.com>
Fri, 2 Dec 2011 12:25:33 +0000 (23:25 +1100)
committerTony Cook <tony@develop-help.com>
Sat, 3 Dec 2011 02:04:28 +0000 (13:04 +1100)
adds a "process" watchdog method that forces use of a separate
process for the watchdog "watcher".

t/op/threads.t
t/test.pl

index 2991f5e..a07fc4a 100644 (file)
@@ -135,6 +135,7 @@ EOI
 #
 # run-time usage of newCONSTSUB (as done by the IO boot code) wasn't
 # thread-safe - got occasional coredumps or malloc corruption
+watchdog(60, "process");
 {
     local $SIG{__WARN__} = sub {};   # Ignore any thread creation failure warnings
     my @t;
@@ -376,7 +377,6 @@ EOF
 
 
 # [perl #78494] Pipes shared between threads block when closed
-watchdog 10;
 {
   my $perl = which_perl;
   $perl = qq'"$perl"' if $perl =~ /\s/;
index a287bc2..a664720 100644 (file)
--- a/t/test.pl
+++ b/t/test.pl
@@ -1262,7 +1262,7 @@ sub watchdog ($;$)
 
     # Don't use a watchdog process if 'threads' is loaded -
     #   use a watchdog thread instead
-    if (!$threads_on) {
+    if (!$threads_on || $method eq "process") {
 
         # On Windows and VMS, try launching a watchdog process
         #   using system(1, ...) (see perlport.pod)