From: Eric Wong Date: Fri, 29 Nov 2019 10:14:10 +0000 (+0000) Subject: ds: ->Reset initializes $nextq X-Git-Tag: v1.3.0~242 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=bdfa98ba4a0458613c10d21c090d65400e2a5297;hp=48282c640eb4871f8fa07ea2ea06a2ef0e16535f;p=public-inbox.git ds: ->Reset initializes $nextq I haven't noticed this being a problem in practice, but be consistent with the rest of the singleton stuff. Since we always call Reset() at load time, only do initialization in that sub and not at declaration. --- diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index 17c640f4..301ec057 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -39,8 +39,8 @@ use Errno qw(EAGAIN EINVAL); use Carp qw(croak confess carp); require File::Spec; -my $nextq = []; # queue for next_tick -my $WaitPids = []; # list of [ pid, callback, callback_arg ] +my $nextq; # queue for next_tick +my $WaitPids; # list of [ pid, callback, callback_arg ] my $reap_timer; our ( %DescriptorMap, # fd (num) -> PublicInbox::DS object @@ -69,6 +69,7 @@ Reset all state =cut sub Reset { %DescriptorMap = (); + $nextq = []; $WaitPids = []; $reap_timer = undef; @ToClose = ();