From: Victor Julien Date: Fri, 25 Jul 2014 15:41:34 +0000 (+0200) Subject: Fix engine getting stuck because of optimizations X-Git-Tag: suricata-2.1beta1~84 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1057%2Fhead;p=thirdparty%2Fsuricata.git Fix engine getting stuck because of optimizations 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. --- diff --git a/src/tmqh-packetpool.c b/src/tmqh-packetpool.c index 1f7f5bd248..1f0a3ec7b9 100644 --- a/src/tmqh-packetpool.c +++ b/src/tmqh-packetpool.c @@ -151,7 +151,7 @@ void PacketPoolWait(void) PktPool *my_pool = GetThreadPacketPool(); while(PacketPoolIsEmpty(my_pool)) - ; + cc_barrier(); } /** \brief a initialized packet