From 1c52f49354aa83e71fcceccae888da0c77f2391d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 1 Oct 2021 09:54:41 +0000 Subject: ds: simplify signalfd use Since signalfd is often combined with our event loop, give it a convenient API and reduce the code duplication required to use it. EventLoop is replaced with ::event_loop to allow consistent parameter passing and avoid needlessly passing the package name on stack. We also avoid exporting SFD_NONBLOCK since it's the only flag we support. There's no sense in having the memory overhead of a constant function when it's in cold code. --- lib/PublicInbox/IPC.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/PublicInbox/IPC.pm') diff --git a/lib/PublicInbox/IPC.pm b/lib/PublicInbox/IPC.pm index 205b5b92..6c189b64 100644 --- a/lib/PublicInbox/IPC.pm +++ b/lib/PublicInbox/IPC.pm @@ -251,7 +251,7 @@ sub wq_worker_loop ($$) { my $wqw = PublicInbox::WQWorker->new($self, $self->{-wq_s2}); PublicInbox::WQWorker->new($self, $bcast2) if $bcast2; PublicInbox::DS->SetPostLoopCallback(sub { $wqw->{sock} }); - PublicInbox::DS->EventLoop; + PublicInbox::DS::event_loop(); PublicInbox::DS->Reset; } @@ -353,7 +353,6 @@ sub _wq_worker_start ($$$$) { delete @$self{qw(-wq_s1 -wq_ppid)}; $self->{-wq_worker_nr} = keys %{delete($self->{-wq_workers}) // {}}; - $SIG{$_} = 'IGNORE' for (qw(PIPE)); $SIG{$_} = 'DEFAULT' for (qw(TTOU TTIN TERM QUIT INT CHLD)); local $0 = $one ? $self->{-wq_ident} : "$self->{-wq_ident} $self->{-wq_worker_nr}"; -- cgit v1.2.3-24-ge0c7