[libdazzle] counters: fix warnings when no memory barrier is needed



commit d48f5e432bd325a4a55528ca12c07737985d92cb
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jun 22 10:43:23 2020 -0700

    counters: fix warnings when no memory barrier is needed

 src/util/dzl-counter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/util/dzl-counter.c b/src/util/dzl-counter.c
index 3cec2f4..2cf972e 100644
--- a/src/util/dzl-counter.c
+++ b/src/util/dzl-counter.c
@@ -53,9 +53,9 @@ G_DEFINE_BOXED_TYPE (DzlCounterArena, dzl_counter_arena, dzl_counter_arena_ref,
   (((sizeof (CounterInfo) * COUNTERS_PER_GROUP) +         \
     (sizeof(DzlCounterValue) * (ncpu))) / DATA_CELL_SIZE)
 #ifdef DZL_COUNTER_REQUIRES_ATOMIC
-#define DZL_MEMORY_BARRIER __sync_synchronize()
+#define DZL_MEMORY_BARRIER G_STMT_START { __sync_synchronize(); } G_STMT_END
 #else
-#define DZL_MEMORY_BARRIER 0
+#define DZL_MEMORY_BARRIER G_STMT_START {} G_STMT_END
 #endif
 
 typedef struct


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]