Skip to content

Commit c220b63

Browse files
committed
test.pl: Don't use watchdog thread unless safe signals
In the thread documentation, I noticed that unsafe signals preclude killing threads with a signal. But this is the normal method for clearing a watchdog timer under threads. I doubt that people are compiling with PERL_OLD_SIGNALS these days, so I didn't check for that, but its easy enough to check for the environment variable that does the same thing at runtime.
1 parent ddb2ff9 commit c220b63

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

t/test.pl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,9 +1888,12 @@ ($;$)
18881888
# shut up use only once warning
18891889
my $threads_on = $threads::threads && $threads::threads;
18901890

1891-
# Use a watchdog process unless 'threads' is loaded
1892-
if (!$threads_on || $method eq "process") {
1893-
1891+
# Use a watchdog process unless 'threads' is loaded and is killable by a
1892+
# signal
1893+
if ( ! $threads_on
1894+
|| (defined $ENV{PERL_SIGNALS} && $ENV{PERL_SIGNALS} eq "unsafe")
1895+
|| $method eq "process")
1896+
{
18941897
# On Windows and VMS, try launching a watchdog process
18951898
# using system(1, ...) (see perlport.pod). system() returns
18961899
# immediately on these platforms with effectively a pid of the new

0 commit comments

Comments
 (0)