Perl may internally race and miss signals due to a lack of
self-pipe / eventfd / signalfd / EVFILT_SIGNAL usage. While our
event loop paths avoid these problems by using signalfd or
EVFILT_SIGNAL, thse sleep() calls are not within the event loop.
if (my $signum = ($code & 127)) { # usually SIGPIPE (13)
$SIG{PIPE} = 'DEFAULT'; # $SIG{$signum} doesn't work
kill $signum, $$;
- sleep; # wait for signal
+ sleep(1) while 1; # wait for signal
} else {
$quit->($code >> 8);
}
sigchld();
if (my $sig = ($x_it_code & 127)) {
kill $sig, $$;
- sleep;
+ sleep(1) while 1;
}
exit($x_it_code >> 8);
} else { # for systems lacking Socket::MsgHdr or Inline::C