From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 10A3F1F9FC; Wed, 24 Mar 2021 23:01:04 +0000 (UTC) Date: Wed, 24 Mar 2021 23:01:03 +0000 From: Eric Wong To: meta@public-inbox.org Subject: [SQUASH] [PATCH 1/9] ds: improve DS->Reset fork-safety Message-ID: References: <20210324092335.12345-1-e@80x24.org> <20210324092335.12345-2-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210324092335.12345-2-e@80x24.org> List-Id: Will squash the following in, no reason to have it accessible via `our' unless we need to debug something. And I initally considered calling it '%state' and stuffing all vars in there, but decided just on-stack vars would be sufficient. diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index c881c895..3cddfd18 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -35,7 +35,7 @@ use Errno qw(EAGAIN EINVAL); use Carp qw(carp croak); our @EXPORT_OK = qw(now msg_more dwaitpid add_timer); -our %Stack; +my %Stack; my $nextq; # queue for next_tick my $wait_pids; # list of [ pid, callback, callback_arg ] my $later_q; # list of callbacks to run at some later interval @@ -66,7 +66,6 @@ Reset(); Reset all state =cut -our %state; sub Reset { do { $in_loop = undef; # first in case DESTROY callbacks use this