The SIGTERM handler doesn't change, so we can reuse it across
different instances without repeatedly creating a new one since
(AFAIK) perl(1) isn't able to deduplicate identical subs. In
any case, looping `local $SIG{TERM} = $coderef' reveals a minor
speedup compared to the equivalent `local $SIG{TERM} = sub {...}'.
x_it($self, 13);
}
+my $term_handler = sub { exit(128 + 15) };
+
sub _lei_atfork_child {
my ($self, $persist) = @_;
# we need to explicitly close things which are on stack
$cb->(@_) unless PublicInbox::Eml::warn_ignore(@_)
};
}
- $SIG{TERM} = sub { exit(128 + 15) };
+ $SIG{TERM} = $term_handler;
$current_lei = $persist ? undef : $self; # for SIG{__WARN__}
}