From b90e8d6e02852c47d0c08198d8c7afb5dbe008d7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 10 Jan 2021 12:15:00 +0000 Subject: ds: block signals when reaping This lets us call dwaitpid long before a process exits and not have to wait around for it. This is advantageous for lei where we can run dwaitpid on the pager as soon as we spawn it, instead of waiting for a client socket to go away on DESTROY. --- lib/PublicInbox/Watch.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/Watch.pm') diff --git a/lib/PublicInbox/Watch.pm b/lib/PublicInbox/Watch.pm index c39ce1a7..9a729140 100644 --- a/lib/PublicInbox/Watch.pm +++ b/lib/PublicInbox/Watch.pm @@ -583,13 +583,13 @@ sub watch_atfork_child ($) { delete $self->{opendirs}; PublicInbox::DS->Reset; %SIG = (%SIG, %{$self->{sig}}, CHLD => 'DEFAULT'); - PublicInbox::Sigfd::sig_setmask($self->{oldset}); + PublicInbox::DS::sig_setmask($self->{oldset}); } sub watch_atfork_parent ($) { my ($self) = @_; _done_for_now($self); - PublicInbox::Sigfd::block_signals(); + PublicInbox::DS::block_signals(); } sub imap_idle_requeue ($) { # DS::add_timer callback @@ -648,7 +648,7 @@ sub event_step { imap_idle_fork($self, $url_intvl); } }; - PublicInbox::Sigfd::sig_setmask($oldset); + PublicInbox::DS::sig_setmask($oldset); die $@ if $@; } fs_scan_step($self) if $self->{mdre}; @@ -716,7 +716,7 @@ sub poll_fetch_fork ($) { # DS::add_timer callback close $w; _exit(0); } - PublicInbox::Sigfd::sig_setmask($oldset); + PublicInbox::DS::sig_setmask($oldset); die "fork: $!" unless defined $pid; $self->{poll_pids}->{$pid} = [ $intvl, $urls ]; PublicInbox::EOFpipe->new($r, \&reap, [$pid, \&poll_fetch_reap, $self]); -- cgit v1.2.3-24-ge0c7