From: Eric Leblond Date: Mon, 17 Sep 2012 13:24:39 +0000 (+0200) Subject: tm-threads: add TM_ECODE_DONE state X-Git-Tag: suricata-1.4rc1~50 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6be63bdc4f65fd7cef5df595a047d2a2302a7bbc;p=thirdparty%2Fsuricata.git tm-threads: add TM_ECODE_DONE state This patch adds a nex return state which can be used by threads to warn that a task has been done. In this case, suricata does not leave. --- diff --git a/src/tm-threads-common.h b/src/tm-threads-common.h index 615a4b5d05..9966040fde 100644 --- a/src/tm-threads-common.h +++ b/src/tm-threads-common.h @@ -85,6 +85,7 @@ typedef enum { typedef enum { TM_ECODE_OK = 0, /**< Thread module exits OK*/ TM_ECODE_FAILED, /**< Thread module exits due to failure*/ + TM_ECODE_DONE, /**< Thread module task is finished*/ } TmEcode; /* ThreadVars type */ diff --git a/src/tm-threads.c b/src/tm-threads.c index 4309b1749f..5921fb8ba8 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -668,6 +668,9 @@ void *TmThreadsSlotPktAcqLoop(void *td) { || suricata_ctl_flags) { run = 0; } + if (r == TM_ECODE_DONE) { + run = 0; + } } SCPerfSyncCounters(tv, 0);