summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glib-2.0/glib-2.0/0016-gobject-Drop-unnecessary-volatile-qualifiers-from-in.patch
blob: 8111b3b51d2109de6f2f0afe2bd0784fd938ab8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
From 08d04d0428cc26935a2d42083f1710432465c98a Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@endlessos.org>
Date: Wed, 11 Nov 2020 18:42:43 +0000
Subject: [PATCH 16/29] gobject: Drop unnecessary volatile qualifiers from
 internal variables
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

These variables were already (correctly) accessed atomically. The
`volatile` qualifier doesn’t help with that.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #600
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719]
---
 gobject/gclosure.c |  2 +-
 gobject/gclosure.h | 20 ++++++++++----------
 gobject/gobject.c  |  4 ++--
 gobject/gtype.c    | 10 +++++-----
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/gobject/gclosure.c b/gobject/gclosure.c
index 1d1f2f48a..6d41e6d8a 100644
--- a/gobject/gclosure.c
+++ b/gobject/gclosure.c
@@ -98,7 +98,7 @@
 
 typedef union {
   GClosure closure;
-  volatile gint vint;
+  gint vint;
 } ClosureInt;
 
 #define CHANGE_FIELD(_closure, _field, _OP, _value, _must_set, _SET_OLD, _SET_NEW)      \
diff --git a/gobject/gclosure.h b/gobject/gclosure.h
index a0f91f538..884e403a8 100644
--- a/gobject/gclosure.h
+++ b/gobject/gclosure.h
@@ -175,20 +175,20 @@ struct _GClosureNotifyData
 struct _GClosure
 {
   /*< private >*/
-  volatile      	guint	 ref_count : 15;
+  guint ref_count : 15;  /* (atomic) */
   /* meta_marshal is not used anymore but must be zero for historical reasons
      as it was exposed in the G_CLOSURE_N_NOTIFIERS macro */
-  volatile       	guint	 meta_marshal_nouse : 1;
-  volatile       	guint	 n_guards : 1;
-  volatile       	guint	 n_fnotifiers : 2;	/* finalization notifiers */
-  volatile       	guint	 n_inotifiers : 8;	/* invalidation notifiers */
-  volatile       	guint	 in_inotify : 1;
-  volatile       	guint	 floating : 1;
+  guint meta_marshal_nouse : 1;  /* (atomic) */
+  guint n_guards : 1;  /* (atomic) */
+  guint n_fnotifiers : 2;  /* finalization notifiers (atomic) */
+  guint n_inotifiers : 8;  /* invalidation notifiers (atomic) */
+  guint in_inotify : 1;  /* (atomic) */
+  guint floating : 1;  /* (atomic) */
   /*< protected >*/
-  volatile         	guint	 derivative_flag : 1;
+  guint derivative_flag : 1;  /* (atomic) */
   /*< public >*/
-  volatile       	guint	 in_marshal : 1;
-  volatile       	guint	 is_invalid : 1;
+  guint in_marshal : 1;  /* (atomic) */
+  guint is_invalid : 1;  /* (atomic) */
 
   /*< private >*/	void   (*marshal)  (GClosure       *closure,
 					    GValue /*out*/ *return_value,
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 6e9c44a1e..a3a32be9f 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -174,9 +174,9 @@ typedef struct
   GTypeInstance  g_type_instance;
 
   /*< private >*/
-  volatile guint ref_count;
+  guint          ref_count;  /* (atomic) */
 #ifdef HAVE_OPTIONAL_FLAGS
-  volatile guint optional_flags;
+  guint          optional_flags;  /* (atomic) */
 #endif
   GData         *qdata;
 } GObjectReal;
diff --git a/gobject/gtype.c b/gobject/gtype.c
index 51dad7690..be5989a3e 100644
--- a/gobject/gtype.c
+++ b/gobject/gtype.c
@@ -221,9 +221,9 @@ typedef enum
 /* --- structures --- */
 struct _TypeNode
 {
-  guint volatile ref_count;
+  guint        ref_count;  /* (atomic) */
 #ifdef G_ENABLE_DEBUG
-  guint volatile instance_count;
+  guint        instance_count;  /* (atomic) */
 #endif
   GTypePlugin *plugin;
   guint        n_children; /* writable with lock */
@@ -233,7 +233,7 @@ struct _TypeNode
   guint        is_instantiatable : 1;
   guint        mutatable_check_cache : 1;	/* combines some common path checks */
   GType       *children; /* writable with lock */
-  TypeData * volatile data;
+  TypeData    *data;
   GQuark       qname;
   GData       *global_gdata;
   union {
@@ -569,8 +569,8 @@ type_node_new_W (TypeNode    *pnode,
 }
 
 static inline IFaceEntry*
-lookup_iface_entry_I (volatile IFaceEntries *entries,
-		      TypeNode *iface_node)
+lookup_iface_entry_I (IFaceEntries *entries,
+                      TypeNode     *iface_node)
 {
   guint8 *offsets;
   guint offset_index;
-- 
2.30.1