]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Fix engine getting stuck because of optimizations 1057/head
authorVictor Julien <victor@inliniac.net>
Fri, 25 Jul 2014 15:41:34 +0000 (17:41 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 25 Jul 2014 15:41:34 +0000 (17:41 +0200)
At -O1+ in both Gcc and Clang, PacketPoolWait would optimize the
wait loop in the wrong way. Adding a compiler barrier to prevent
this optimization issue.

src/tmqh-packetpool.c

index 1f7f5bd248c09981ea484569ea530c7c9ec6dc63..1f0a3ec7b94b0b0de3fbb38c05ba8f5164d89a62 100644 (file)
@@ -151,7 +151,7 @@ void PacketPoolWait(void)
     PktPool *my_pool = GetThreadPacketPool();
 
     while(PacketPoolIsEmpty(my_pool))
-        ;
+        cc_barrier();
 }
 
 /** \brief a initialized packet