From bdfa98ba4a0458613c10d21c090d65400e2a5297 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 29 Nov 2019 10:14:10 +0000 Subject: 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. --- lib/PublicInbox/DS.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 = (); -- cgit v1.2.3-24-ge0c7