]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
threading/queues: add shortcut for packetpool check
authorVictor Julien <victor@inliniac.net>
Sun, 3 Nov 2019 08:52:21 +0000 (09:52 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 7 Feb 2020 14:43:10 +0000 (15:43 +0100)
Allows code simplifycation in the threading loops.

src/tm-queues.c
src/tm-queues.h

index 1e80d159355633672834d9c3706e3f3970e00e0a..888a4bc0bd55b1e30f16e4ef35e0d174116bef1c 100644 (file)
@@ -44,6 +44,7 @@ Tmq *TmqCreateQueue(const char *name)
         goto error;
 
     q->id = tmq_id++;
+    q->is_packet_pool = (strcmp(q->name, "packetpool") == 0);
 
     SCLogDebug("created queue \'%s\', %p", name, q);
     return q;
index 502ef2cd56125ea8d701d265e495981dd6e29283..5b72c3aa0ac535da64ee8710080c1209e3da160c 100644 (file)
@@ -26,6 +26,7 @@
 
 typedef struct Tmq_ {
     char *name;
+    bool is_packet_pool;
     uint16_t id;
     uint16_t reader_cnt;
     uint16_t writer_cnt;