]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
affinity: add call to setup function in threads
authorEric Leblond <eric@regit.org>
Wed, 5 Sep 2012 06:53:41 +0000 (08:53 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 6 Sep 2012 05:51:27 +0000 (07:51 +0200)
Threads created through TMThreadSpawn need to call the affinity
function by themselves.

src/counters.c
src/detect-engine.c
src/flow-manager.c

index 6ffe629a6db534489ed0b0a19958cecf35fa064f..0b36e26dece5062ca6f2bfee3462faea32070c73 100644 (file)
@@ -446,11 +446,15 @@ static void *SCPerfMgmtThread(void *arg)
         SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
     }
 
+    if (tv_local->thread_setup_flags != 0)
+        TmThreadSetupOptions(tv_local);
+
     /* Set the threads capability */
     tv_local->cap_flags = 0;
 
     SCDropCaps(tv_local);
 
+
     if (sc_perf_op_ctx == NULL) {
         SCLogError(SC_ERR_PERF_STATS_NOT_INIT, "Perf Counter API not init"
                    "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");
     }
 
+    if (tv_local->thread_setup_flags != 0)
+        TmThreadSetupOptions(tv_local);
+
     /* Set the threads capability */
     tv_local->cap_flags = 0;
 
index 032955d0767ec30138c1297b2f14f721d73acf75..469f95df41d0e3ba984dc10444e9951c92660311 100644 (file)
@@ -88,6 +88,9 @@ static void *DetectEngineLiveRuleSwap(void *arg)
     /* block usr2.  usr2 to be handled by the main thread only */
     UtilSignalBlock(SIGUSR2);
 
+    if (tv_local->thread_setup_flags != 0)
+        TmThreadSetupOptions(tv_local);
+
     /* release TmThreadSpawn */
     TmThreadsSetFlag(tv_local, THV_INIT_DONE);
 
index 89afcfc67592c0ce4a23ec274bf69ab8dd9a4ce7..95ef705a2d008511288154298a3a22257ab9b1f9 100644 (file)
@@ -418,6 +418,9 @@ void *FlowManagerThread(void *td)
             SC_PERF_TYPE_UINT64,
             "NULL");
 
+    if (th_v->thread_setup_flags != 0)
+        TmThreadSetupOptions(th_v);
+
     memset(&ts, 0, sizeof(ts));
 
     FlowForceReassemblySetup();