user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 01/12] ipc: remove {-reap_async} field
Date: Tue, 17 Jan 2023 07:19:00 +0000	[thread overview]
Message-ID: <20230117071911.1577890-2-e@80x24.org> (raw)
In-Reply-To: <20230117071911.1577890-1-e@80x24.org>

We can just test for {-reap_do}, instead to save us a few bytes.
---
 lib/PublicInbox/IPC.pm | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/PublicInbox/IPC.pm b/lib/PublicInbox/IPC.pm
index 74862673..671ad5d5 100644
--- a/lib/PublicInbox/IPC.pm
+++ b/lib/PublicInbox/IPC.pm
@@ -150,7 +150,6 @@ sub ipc_worker_reap { # dwaitpid callback
 sub wq_wait_async {
 	my ($self, $cb, @uargs) = @_;
 	local $PublicInbox::DS::in_loop = 1;
-	$self->{-reap_async} = 1;
 	$self->{-reap_do} = $cb;
 	my @pids = keys %{$self->{-wq_workers}};
 	dwaitpid($_, \&ipc_worker_reap, [ $self, @uargs ]) for @pids;
@@ -350,7 +349,7 @@ sub wq_do {
 
 sub prepare_nonblock {
 	($_[0]->{-wq_s1} // die 'BUG: no {-wq_s1}')->blocking(0);
-	$_[0]->{-reap_async} or die 'BUG: {-reap_async} needed for nonblock';
+	$_[0]->{-reap_do} or die 'BUG: {-reap_do} needed for nonblock';
 	require PublicInbox::WQBlocked;
 }
 
@@ -424,11 +423,11 @@ sub wq_workers_start {
 sub wq_close {
 	my ($self) = @_;
 	if (my $wqb = delete $self->{wqb}) {
-		$self->{-reap_async} or die 'BUG: {-reap_async} unset';
+		$self->{-reap_do} or die 'BUG: {-reap_do} unset';
 		$wqb->enq_close;
 	}
 	delete @$self{qw(-wq_s1 -wq_s2)} or return;
-	return if $self->{-reap_async};
+	return if $self->{-reap_do};
 	my @pids = keys %{$self->{-wq_workers}};
 	dwaitpid($_, \&ipc_worker_reap, [ $self ]) for @pids;
 }

  reply	other threads:[~2023-01-17  7:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17  7:18 [PATCH 00/12] improve process reaping Eric Wong
2023-01-17  7:19 ` Eric Wong [this message]
2023-01-17  7:19 ` [PATCH 02/12] t/solver_git.t: fix test message Eric Wong
2023-01-17  7:19 ` [PATCH 03/12] qspawn: drop {psgi_env} deref Eric Wong
2023-01-17  7:19 ` [PATCH 04/12] ds: introduce awaitpid, switch ProcessPipe users Eric Wong
2023-01-18  2:10   ` [PATCH 13/12] qspawn: use ->DESTROY to force ->finalize Eric Wong
2023-01-17  7:19 ` [PATCH 05/12] git|gcf2: switch to awaitpid Eric Wong
2023-01-17  7:19 ` [PATCH 06/12] watch: " Eric Wong
2023-01-17  7:19 ` [PATCH 07/12] watch: simplify internal data structures Eric Wong
2023-01-17  7:19 ` [PATCH 08/12] eofpipe: drop {arg} support for now Eric Wong
2023-01-17  7:19 ` [PATCH 09/12] watch: IMAP and NNTP polling can use the same interval Eric Wong
2023-01-17  7:19 ` [PATCH 10/12] ipc: drop unused $args from ->ipc_worker_stop Eric Wong
2023-01-17  7:19 ` [PATCH 11/12] ipc+lei: switch to awaitpid Eric Wong
2023-01-17  7:19 ` [PATCH 12/12] ds: drop dwaitpid, switch to waitpid(-1) Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230117071911.1577890-2-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).