Skip to content

Commit ac78c4b

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 it's easy enough to check for the environment variable that does the same thing at runtime.
1 parent 318cb22 commit ac78c4b

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
@@ -1890,9 +1890,12 @@ ($;$)
18901890
# shut up use only once warning
18911891
my $threads_on = $threads::threads && $threads::threads;
18921892

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

0 commit comments

Comments
 (0)