flow-recycler: speed up flow-recycler shutdown

Thread was killed by the generic TmThreadKillThreads instead of
the FlowKillFlowRecyclerThread. The latter wakes the thread up, so
that shutdown is quite a bit faster.
pull/1058/head
Victor Julien 12 years ago
parent 6f9a2fcd58
commit 8c231702d9

@ -769,6 +769,8 @@ void FlowKillFlowRecyclerThread(void)
TmThreadsSetFlag(tv, THV_KILL);
TmThreadsSetFlag(tv, THV_DEINIT);
SCCtrlCondSignal(&flow_recycler_ctrl_cond);
/* be sure it has shut down */
while (!TmThreadsCheckFlag(tv, THV_CLOSED)) {
usleep(100);

@ -2402,11 +2402,16 @@ int main(int argc, char **argv)
BUG_ON(global_de_ctx == NULL);
}
/* before TmThreadKillThreads, as otherwise that kills it
* but more slowly */
if (suri.run_mode != RUNMODE_UNIX_SOCKET) {
FlowKillFlowRecyclerThread();
}
TmThreadKillThreads();
if (suri.run_mode != RUNMODE_UNIX_SOCKET) {
SCPerfReleaseResources();
FlowKillFlowRecyclerThread();
FlowShutdown();
StreamTcpFreeConfig(STREAM_VERBOSE);
}

Loading…
Cancel
Save