threading: simplify packetpool checks

pull/4531/head
Victor Julien 6 years ago
parent 603b2ced47
commit b1056b3836

@ -1425,12 +1425,10 @@ void TmThreadRemove(ThreadVars *tv, int type)
static bool ThreadStillHasPackets(ThreadVars *tv) 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 /* we wait till we dry out all the inq packets, before we
* kill this thread. Do note that you should have disabled * kill this thread. Do note that you should have disabled
* packet acquire by now using TmThreadDisableReceiveThreads()*/ * 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]; PacketQueue *q = &trans_q[tv->inq->id];
SCMutexLock(&q->mutex_q); SCMutexLock(&q->mutex_q);
uint32_t len = q->len; uint32_t len = q->len;
@ -1439,7 +1437,6 @@ static bool ThreadStillHasPackets(ThreadVars *tv)
return true; return true;
} }
} }
}
if (tv->stream_pq != NULL) { if (tv->stream_pq != NULL) {
SCMutexLock(&tv->stream_pq->mutex_q); SCMutexLock(&tv->stream_pq->mutex_q);

Loading…
Cancel
Save