detect/loader: set proper thread flags

Fixes: 13beba141c ("source: add THV_RUNNING flag to notify of running state")

Bug: #6043.
pull/8817/head
Victor Julien 2 years ago
parent d630f0fa34
commit 74d03c2b61

@ -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;
}

Loading…
Cancel
Save