diff options
author | Eric Wong <e@80x24.org> | 2019-11-29 10:14:10 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-12-11 08:10:28 +0000 |
commit | bdfa98ba4a0458613c10d21c090d65400e2a5297 (patch) | |
tree | e1941ee47f291443fed277000a987eba6f076308 | |
parent | 48282c640eb4871f8fa07ea2ea06a2ef0e16535f (diff) | |
download | public-inbox-bdfa98ba4a0458613c10d21c090d65400e2a5297.tar.gz |
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.
-rw-r--r-- | lib/PublicInbox/DS.pm | 5 |
1 files 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 = (); |