Skip to content

Commit

Permalink
threads: count thread types after all initialized
Browse files Browse the repository at this point in the history
To avoid double counting in case a thread took longer than
expected to start up.
  • Loading branch information
victorjulien committed Oct 27, 2022
1 parent 6621b0e commit 91b7b63
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/tm-threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -1830,7 +1830,11 @@ TmEcode TmThreadWaitOnThreadRunning(void)
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)
Expand All @@ -1841,8 +1845,6 @@ TmEcode TmThreadWaitOnThreadRunning(void)
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);
Expand Down

0 comments on commit 91b7b63

Please sign in to comment.