]> Sergey Matveev's repositories - public-inbox.git/commitdiff
ds: clobber $in_loop first at reset
authorEric Wong <e@80x24.org>
Thu, 31 Dec 2020 13:51:53 +0000 (13:51 +0000)
committerEric Wong <e@80x24.org>
Fri, 1 Jan 2021 05:00:40 +0000 (05:00 +0000)
This may help ensure DESTROY callbacks will see in_loop
before the others.

lib/PublicInbox/DS.pm

index 4f1558c7c07a36c392c723fbc7c56c5a14608af8..8a560ae8b4ad53be049d051350efde8af98e0b9b 100644 (file)
@@ -66,8 +66,9 @@ Reset all state
 
 =cut
 sub Reset {
+    $in_loop = undef; # first in case DESTROY callbacks use this
     %DescriptorMap = ();
-    $in_loop = $wait_pids = $later_queue = $reap_armed = undef;
+    $wait_pids = $later_queue = $reap_armed = undef;
     $EXPMAP = {};
     $nextq = $ToClose = $later_timer = $exp_timer = undef;
     $LoopTimeout = -1;  # no timeout by default