diff --git a/src/detect-engine-loader.c b/src/detect-engine-loader.c index 1ec6944f4a..45ea349abd 100644 --- a/src/detect-engine-loader.c +++ b/src/detect-engine-loader.c @@ -582,6 +582,7 @@ static TmEcode DetectLoader(ThreadVars *th_v, void *thread_data) DetectLoaderThreadData *ftd = (DetectLoaderThreadData *)thread_data; BUG_ON(ftd == NULL); + TmThreadsSetFlag(th_v, THV_INIT_DONE | THV_RUNNING); SCLogDebug("loader thread started"); while (1) { @@ -619,6 +620,10 @@ static TmEcode DetectLoader(ThreadVars *th_v, void *thread_data) SCLogDebug("woke up..."); } + TmThreadsSetFlag(th_v, THV_RUNNING_DONE); + TmThreadWaitForFlag(th_v, THV_DEINIT); + TmThreadsSetFlag(th_v, THV_CLOSED); + return TM_ECODE_OK; }