affinity: add call to setup function in threads

Threads created through TMThreadSpawn need to call the affinity
function by themselves.
pull/54/merge
Eric Leblond 14 years ago committed by Victor Julien
parent 0eeccb4b17
commit d1569337a7

@ -446,11 +446,15 @@ static void *SCPerfMgmtThread(void *arg)
SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name"); SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
} }
if (tv_local->thread_setup_flags != 0)
TmThreadSetupOptions(tv_local);
/* Set the threads capability */ /* Set the threads capability */
tv_local->cap_flags = 0; tv_local->cap_flags = 0;
SCDropCaps(tv_local); SCDropCaps(tv_local);
if (sc_perf_op_ctx == NULL) { if (sc_perf_op_ctx == NULL) {
SCLogError(SC_ERR_PERF_STATS_NOT_INIT, "Perf Counter API not init" SCLogError(SC_ERR_PERF_STATS_NOT_INIT, "Perf Counter API not init"
"SCPerfInitCounterApi() has to be called first"); "SCPerfInitCounterApi() has to be called first");
@ -507,6 +511,9 @@ static void *SCPerfWakeupThread(void *arg)
SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name"); SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
} }
if (tv_local->thread_setup_flags != 0)
TmThreadSetupOptions(tv_local);
/* Set the threads capability */ /* Set the threads capability */
tv_local->cap_flags = 0; tv_local->cap_flags = 0;

@ -88,6 +88,9 @@ static void *DetectEngineLiveRuleSwap(void *arg)
/* block usr2. usr2 to be handled by the main thread only */ /* block usr2. usr2 to be handled by the main thread only */
UtilSignalBlock(SIGUSR2); UtilSignalBlock(SIGUSR2);
if (tv_local->thread_setup_flags != 0)
TmThreadSetupOptions(tv_local);
/* release TmThreadSpawn */ /* release TmThreadSpawn */
TmThreadsSetFlag(tv_local, THV_INIT_DONE); TmThreadsSetFlag(tv_local, THV_INIT_DONE);

@ -418,6 +418,9 @@ void *FlowManagerThread(void *td)
SC_PERF_TYPE_UINT64, SC_PERF_TYPE_UINT64,
"NULL"); "NULL");
if (th_v->thread_setup_flags != 0)
TmThreadSetupOptions(th_v);
memset(&ts, 0, sizeof(ts)); memset(&ts, 0, sizeof(ts));
FlowForceReassemblySetup(); FlowForceReassemblySetup();

Loading…
Cancel
Save