about summary refs log tree commit homepage
path: root/lib/PublicInbox/IPC.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-01-17 07:19:00 +0000
committerEric Wong <e@80x24.org>2023-01-18 23:25:46 +0000
commit04b41fe3123c890a3fa73d5f7dd1cf5257d09de8 (patch)
treebad21ef9f92e6f2af83a309a6f8a9911cc8c20ea /lib/PublicInbox/IPC.pm
parent1e0709d33ca040b8b1ac6b84e5b07a4cee3a6ced (diff)
downloadpublic-inbox-04b41fe3123c890a3fa73d5f7dd1cf5257d09de8.tar.gz
We can just test for {-reap_do}, instead to save us a few bytes.
Diffstat (limited to 'lib/PublicInbox/IPC.pm')
-rw-r--r--lib/PublicInbox/IPC.pm7
1 files 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;
 }