From: Victor Julien Date: Sun, 3 Oct 2021 12:54:17 +0000 (+0200) Subject: threading: minor cleanups X-Git-Tag: suricata-6.0.4~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e36ded82756b93f9c4440dd4aa6fc1dc9109c47b;p=thirdparty%2Fsuricata.git threading: minor cleanups (cherry picked from commit 31977170a8a44290fd8f501ef1018b7696644040) --- diff --git a/src/tm-threads.c b/src/tm-threads.c index 51f74c2a77..d9c5160784 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -1339,17 +1339,16 @@ again: if (!fq_done) { SCMutexUnlock(&tv_root_lock); - Packet *p = PacketGetFromAlloc(); - if (p != NULL) { - //SCLogNotice("flush packet created"); - p->flags |= PKT_PSEUDO_STREAM_END; - PKT_SET_SRC(p, PKT_SRC_DETECT_RELOAD_FLUSH); - PacketQueue *q = tv->stream_pq; - SCMutexLock(&q->mutex_q); - PacketEnqueue(q, p); - SCCondSignal(&q->cond_q); - SCMutexUnlock(&q->mutex_q); - } + Packet *p = PacketGetFromAlloc(); + if (p != NULL) { + p->flags |= PKT_PSEUDO_STREAM_END; + PKT_SET_SRC(p, PKT_SRC_DETECT_RELOAD_FLUSH); + PacketQueue *q = tv->stream_pq; + SCMutexLock(&q->mutex_q); + PacketEnqueue(q, p); + SCCondSignal(&q->cond_q); + SCMutexUnlock(&q->mutex_q); + } /* don't sleep while holding a lock */ SleepMsec(1); @@ -1430,7 +1429,6 @@ again: Packet *p = PacketGetFromAlloc(); if (p != NULL) { - //SCLogNotice("flush packet created"); p->flags |= PKT_PSEUDO_STREAM_END; PKT_SET_SRC(p, PKT_SRC_DETECT_RELOAD_FLUSH); PacketQueue *q = tv->stream_pq;