From: Victor Julien Date: Sun, 3 Nov 2019 08:58:34 +0000 (+0100) Subject: threading: simplify packetpool checks X-Git-Tag: suricata-6.0.0-beta1~821 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1056b38367ad342c94a538629faa5b7ad7af684;p=thirdparty%2Fsuricata.git threading: simplify packetpool checks --- diff --git a/src/tm-threads.c b/src/tm-threads.c index 95c14e1a5d..c32512b8a9 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -1425,19 +1425,16 @@ void TmThreadRemove(ThreadVars *tv, int type) static bool ThreadStillHasPackets(ThreadVars *tv) { - if (tv->inq != NULL) { + if (tv->inq != NULL && !tv->inq->is_packet_pool) { /* we wait till we dry out all the inq packets, before we * kill this thread. Do note that you should have disabled * packet acquire by now using TmThreadDisableReceiveThreads()*/ - if (!(strlen(tv->inq->name) == strlen("packetpool") && - strcasecmp(tv->inq->name, "packetpool") == 0)) { - PacketQueue *q = &trans_q[tv->inq->id]; - SCMutexLock(&q->mutex_q); - uint32_t len = q->len; - SCMutexUnlock(&q->mutex_q); - if (len != 0) { - return true; - } + PacketQueue *q = &trans_q[tv->inq->id]; + SCMutexLock(&q->mutex_q); + uint32_t len = q->len; + SCMutexUnlock(&q->mutex_q); + if (len != 0) { + return true; } }