From: Victor Julien Date: Mon, 11 Nov 2019 19:53:03 +0000 (+0100) Subject: threading: remove unused 'TmThreadRemove' function X-Git-Tag: suricata-6.0.0-beta1~794 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f53f004917c955b5dcb195603aeee76d6e0386a1;p=thirdparty%2Fsuricata.git threading: remove unused 'TmThreadRemove' function --- diff --git a/src/tm-threads.c b/src/tm-threads.c index 878934e1c7..912d110146 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -1344,42 +1344,6 @@ void TmThreadAppend(ThreadVars *tv, int type) return; } -/** - * \brief Removes this TV from tv_root based on its type - * - * \param tv The tv instance to remove from the global tv list. - * \param type Holds the type this TV belongs to. - */ -void TmThreadRemove(ThreadVars *tv, int type) -{ - SCMutexLock(&tv_root_lock); - - if (tv_root[type] == NULL) { - SCMutexUnlock(&tv_root_lock); - - return; - } - - ThreadVars *t = tv_root[type]; - while (t != tv) { - t = t->next; - } - - if (t != NULL) { - if (t->prev != NULL) - t->prev->next = t->next; - if (t->next != NULL) - t->next->prev = t->prev; - - if (t == tv_root[type]) - tv_root[type] = t->next;; - } - - SCMutexUnlock(&tv_root_lock); - - return; -} - static bool ThreadStillHasPackets(ThreadVars *tv) { if (tv->inq != NULL && !tv->inq->is_packet_pool) { diff --git a/src/tm-threads.h b/src/tm-threads.h index 6ce9c5e07b..1fc9469c8f 100644 --- a/src/tm-threads.h +++ b/src/tm-threads.h @@ -107,7 +107,6 @@ void TmThreadKillThreadsFamily(int family); void TmThreadKillThreads(void); void TmThreadClearThreadsFamily(int family); void TmThreadAppend(ThreadVars *, int); -void TmThreadRemove(ThreadVars *, int); void TmThreadSetGroupName(ThreadVars *tv, const char *name); void TmThreadDumpThreads(void);