From: Victor Julien Date: Thu, 27 Oct 2022 10:17:11 +0000 (+0200) Subject: threads: count thread types after all initialized X-Git-Tag: suricata-7.0.0-rc1~447 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91b7b63ed2345e543a31f150b419874257216193;p=thirdparty%2Fsuricata.git threads: count thread types after all initialized To avoid double counting in case a thread took longer than expected to start up. --- diff --git a/src/tm-threads.c b/src/tm-threads.c index 7a0f195826..75977cb249 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -1830,7 +1830,11 @@ again: SleepUsec(100); goto again; } - + tv = tv->next; + } + } + for (int i = 0; i < TVT_MAX; i++) { + for (ThreadVars *tv = tv_root[i]; tv != NULL; tv = tv->next) { if (strncmp(thread_name_autofp, tv->name, strlen(thread_name_autofp)) == 0) RX_num++; else if (strncmp(thread_name_workers, tv->name, strlen(thread_name_workers)) == 0) @@ -1841,8 +1845,6 @@ again: FM_num++; else if (strncmp(thread_name_flow_rec, tv->name, strlen(thread_name_flow_rec)) == 0) FR_num++; - - tv = tv->next; } } SCMutexUnlock(&tv_root_lock);