From: Eric Leblond Date: Wed, 26 Sep 2012 14:03:33 +0000 (+0200) Subject: tm-thread: detect thread death X-Git-Tag: suricata-1.4beta2~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ffbbff9d6c13eb5fb4eb4171ac78f7ccc6e266a5;p=thirdparty%2Fsuricata.git tm-thread: detect thread death 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 --- diff --git a/src/tm-threads.c b/src/tm-threads.c index 3286da52d9..6a403752e6 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -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);