Single thread kill also checks if inq is cleared before shutting down

remotes/origin/master-1.1.x
Anoop Saldanha 14 years ago committed by Victor Julien
parent 8fa923c5ac
commit 56432cee16

@ -1313,6 +1313,19 @@ void TmThreadKillThread(ThreadVars *tv)
if (tv == NULL)
return;
if (tv->inq != NULL) {
/* 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];
while (q->len != 0) {
usleep(1000);
}
}
}
/* set the thread flag informing the thread that it needs to be
* terminated */
TmThreadsSetFlag(tv, THV_KILL);

Loading…
Cancel
Save