]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
tm-threads: add TM_ECODE_DONE state
authorEric Leblond <eric@regit.org>
Mon, 17 Sep 2012 13:24:39 +0000 (15:24 +0200)
committerEric Leblond <eric@regit.org>
Mon, 19 Nov 2012 22:52:19 +0000 (23:52 +0100)
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.

src/tm-threads-common.h
src/tm-threads.c

index 615a4b5d05250f1665221ed5edee6c124e8f328e..9966040fde0f5223f7463bf701e599d7de946e43 100644 (file)
@@ -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 */
index 4309b1749fc887b00743536e59c1b8461f26fe34..5921fb8ba8b52f5bcb933980d61c7b6935cd5516 100644 (file)
@@ -668,6 +668,9 @@ void *TmThreadsSlotPktAcqLoop(void *td) {
             || suricata_ctl_flags) {
             run = 0;
         }
+        if (r == TM_ECODE_DONE) {
+            run = 0;
+        }
     }
     SCPerfSyncCounters(tv, 0);