]> Sergey Matveev's repositories - public-inbox.git/commit
ds: simplify signalfd use
authorEric Wong <e@80x24.org>
Fri, 1 Oct 2021 09:54:41 +0000 (09:54 +0000)
committerEric Wong <e@80x24.org>
Fri, 1 Oct 2021 12:06:31 +0000 (12:06 +0000)
commit1c52f49354aa83e71fcceccae888da0c77f2391d
treebd6eabaed8cc0376e4a56cb6ec34cf962fd7ffdb
parent5824d0d4ffac120a2840c980b4570868d6b3ea6b
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.
22 files changed:
lib/PublicInbox/ConfigIter.pm
lib/PublicInbox/DS.pm
lib/PublicInbox/DSKQXS.pm
lib/PublicInbox/Daemon.pm
lib/PublicInbox/ExtMsg.pm
lib/PublicInbox/ExtSearchIdx.pm
lib/PublicInbox/Gcf2Client.pm
lib/PublicInbox/IPC.pm
lib/PublicInbox/LEI.pm
lib/PublicInbox/Qspawn.pm
lib/PublicInbox/Sigfd.pm
lib/PublicInbox/Syscall.pm
lib/PublicInbox/Watch.pm
script/public-inbox-watch
t/dir_idle.t
t/ds-leak.t
t/imapd.t
t/nntpd.t
t/sigfd.t
t/watch_maildir.t
xt/mem-imapd-tls.t
xt/net_writer-imap.t