[glib] gmain: Mark some ref_count variables as volatile



commit 9297a596d629cf8666e858907c5b1d85d3e0745b
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Tue Sep 30 18:56:18 2014 +0100

    gmain: Mark some ref_count variables as volatile
    
    To make it more obvious they should exclusively be accessed with atomic
    functions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=737677

 glib/gmain.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glib/gmain.c b/glib/gmain.c
index 2ea6c79..6a8a275 100644
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -268,7 +268,7 @@ struct _GMainContext
   guint owner_count;
   GSList *waiters;
 
-  gint ref_count;
+  volatile gint ref_count;
 
   GHashTable *sources;              /* guint -> GSource */
 
@@ -310,7 +310,7 @@ struct _GMainLoop
 {
   GMainContext *context;
   gboolean is_running;
-  gint ref_count;
+  volatile gint ref_count;
 };
 
 struct _GTimeoutSource


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