Skip to content

Commit bcb1bff

Browse files
committed
foreign thread signal forwarding: swap tests to support OpenBSD
On OpenBSD, With the tests in the original order, with the parent process setting a signal handler and accepting a foreign signal, the child process test would block busy waiting when the child process called exit. From looking at kdump the child process is busy waiting on sched_yield outside the perl process. Since this appears to be OpenBSD specific (other BSD, linux, MacOS work fine), and the sequence causing the problem seems unlikely outside a test scenario I'm not going to investigate further.
1 parent bd91c49 commit bcb1bff

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

ext/XS-APItest/t/thread.t

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ SKIP:
3838
}
3939
}
4040

41-
{
42-
my $saw_signal;
43-
local $SIG{USR1} = sub { ++$saw_signal };
44-
my $pid = make_signal_thread();
45-
join_signal_thread($pid);
46-
ok($saw_signal, "saw signal sent to non-perl thread");
47-
}
48-
4941
{
5042
$Config{d_fork}
5143
or skip "Need fork", 1;
@@ -68,4 +60,13 @@ SKIP:
6860
}
6961
}
7062

63+
{
64+
my $saw_signal;
65+
local $SIG{USR1} = sub { ++$saw_signal };
66+
my $pid = make_signal_thread();
67+
join_signal_thread($pid);
68+
ok($saw_signal, "saw signal sent to non-perl thread");
69+
}
70+
71+
7172
done_testing();

0 commit comments

Comments
 (0)