]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
threading: fix flow timeout loop race
authorVictor Julien <victor@inliniac.net>
Fri, 8 Nov 2019 10:35:02 +0000 (11:35 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 19 Nov 2019 16:24:43 +0000 (17:24 +0100)
src/tm-threads.c

index 9d5105a6ef5d6685f72d841a6afd0eb961f1d606..bd1a856988d06b49731fc716dbcd57e91bc92909 100644 (file)
@@ -217,12 +217,11 @@ static int TmThreadTimeoutLoop(ThreadVars *tv, TmSlot *s)
                 }
             }
         } else {
+            if (TmThreadsCheckFlag(tv, THV_KILL)) {
+                break;
+            }
             SleepUsec(1);
         }
-
-        if (tv->stream_pq->len == 0 && TmThreadsCheckFlag(tv, THV_KILL)) {
-            break;
-        }
     }
     SCLogDebug("flow end loop complete");