summaryrefslogtreecommitdiffstats
path: root/src/detect-engine-loader.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/detect-engine-loader.c')
-rw-r--r--src/detect-engine-loader.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/detect-engine-loader.c b/src/detect-engine-loader.c
index e41f277..0cdb453 100644
--- a/src/detect-engine-loader.c
+++ b/src/detect-engine-loader.c
@@ -456,6 +456,12 @@ int DetectLoadersSync(void)
done = true;
}
SCMutexUnlock(&loader->m);
+ if (!done) {
+ /* nudge thread in case it's sleeping */
+ SCCtrlMutexLock(loader->tv->ctrl_mutex);
+ pthread_cond_broadcast(loader->tv->ctrl_cond);
+ SCCtrlMutexUnlock(loader->tv->ctrl_mutex);
+ }
}
SCMutexLock(&loader->m);
if (loader->result != 0) {
@@ -511,7 +517,9 @@ static void TmThreadWakeupDetectLoaderThreads(void)
while (tv != NULL) {
if (strncmp(tv->name,"DL#",3) == 0) {
BUG_ON(tv->ctrl_cond == NULL);
+ SCCtrlMutexLock(tv->ctrl_mutex);
pthread_cond_broadcast(tv->ctrl_cond);
+ SCCtrlMutexUnlock(tv->ctrl_mutex);
}
tv = tv->next;
}
@@ -555,6 +563,9 @@ static TmEcode DetectLoaderThreadInit(ThreadVars *t, const void *initdata, void
/* pass thread data back to caller */
*data = ftd;
+ DetectLoaderControl *loader = &loaders[ftd->instance];
+ loader->tv = t;
+
return TM_ECODE_OK;
}