]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
tm-thread: detect thread death 98/head
authorEric Leblond <eric@regit.org>
Wed, 26 Sep 2012 14:03:33 +0000 (16:03 +0200)
committerEric Leblond <eric@regit.org>
Wed, 26 Sep 2012 14:03:33 +0000 (16:03 +0200)
When a thread is dead at init the THV_INIT_DONE flag is not set
and the spawn function can freeze (see bug #553 for an example).
In this case THV_RUNNING_DONE is set and we can also check on this
state for leaving the function. This should fix #bug553

src/tm-threads.c

index 3286da52d961bd25ebae19a493a99c035051f997..6a403752e698c52eb07f8949358cc79233b4217d 100644 (file)
@@ -1771,7 +1771,7 @@ TmEcode TmThreadSpawn(ThreadVars *tv)
         return TM_ECODE_FAILED;
     }
 
-    TmThreadWaitForFlag(tv, THV_INIT_DONE);
+    TmThreadWaitForFlag(tv, THV_INIT_DONE | THV_RUNNING_DONE);
 
     TmThreadAppend(tv, tv->type);