From c53b4280795088a50e26c216ea023d13822b33f5 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 25 Jul 2014 17:41:34 +0200 Subject: [PATCH] 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. --- src/tmqh-packetpool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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