summaryrefslogtreecommitdiff
path: root/gobject/gtype.c
diff options
context:
space:
mode:
Diffstat (limited to 'gobject/gtype.c')
-rw-r--r--gobject/gtype.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/gobject/gtype.c b/gobject/gtype.c
index 51dad7690..909faf138 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 {
@@ -322,7 +322,7 @@ struct _ClassData
CommonData common;
guint16 class_size;
guint16 class_private_size;
- int volatile init_state; /* atomic - g_type_class_ref reads it unlocked */
+ int init_state; /* (atomic) - g_type_class_ref reads it unlocked */
GBaseInitFunc class_init_base;
GBaseFinalizeFunc class_finalize_base;
GClassInitFunc class_init;
@@ -336,7 +336,7 @@ struct _InstanceData
CommonData common;
guint16 class_size;
guint16 class_private_size;
- int volatile init_state; /* atomic - g_type_class_ref reads it unlocked */
+ int init_state; /* (atomic) - g_type_class_ref reads it unlocked */
GBaseInitFunc class_init_base;
GBaseFinalizeFunc class_finalize_base;
GClassInitFunc class_init;
@@ -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;
@@ -1415,7 +1415,7 @@ type_node_add_iface_entry_W (TypeNode *node,
if (parent_entry)
{
- if (node->data && node->data->class.init_state >= BASE_IFACE_INIT)
+ if (node->data && g_atomic_int_get (&node->data->class.init_state) >= BASE_IFACE_INIT)
{
entries->entry[i].init_state = INITIALIZED;
entries->entry[i].vtable = parent_entry->vtable;
@@ -1481,7 +1481,7 @@ type_add_interface_Wm (TypeNode *node,
*/
if (node->data)
{
- InitState class_state = node->data->class.init_state;
+ InitState class_state = g_atomic_int_get (&node->data->class.init_state);
if (class_state >= BASE_IFACE_INIT)
type_iface_vtable_base_init_Wm (iface, node);
@@ -2175,7 +2175,7 @@ type_class_init_Wm (TypeNode *node,
g_assert (node->is_classed && node->data &&
node->data->class.class_size &&
!node->data->class.class &&
- node->data->class.init_state == UNINITIALIZED);
+ g_atomic_int_get (&node->data->class.init_state) == UNINITIALIZED);
if (node->data->class.class_private_size)
class = g_malloc0 (ALIGN_STRUCT (node->data->class.class_size) + node->data->class.class_private_size);
else
@@ -2290,7 +2290,7 @@ type_class_init_Wm (TypeNode *node,
* inherited interfaces are already init_state == INITIALIZED, because
* they either got setup in the above base_init loop, or during
* class_init from within type_add_interface_Wm() for this or
- * an anchestor type.
+ * an ancestor type.
*/
i = 0;
while ((entries = CLASSED_NODE_IFACES_ENTRIES_LOCKED (node)) != NULL)
@@ -3462,7 +3462,7 @@ g_type_depth (GType type)
* be used to determine the types and order in which the leaf type is
* descended from the root type.
*
- * Returns: immediate child of @root_type and anchestor of @leaf_type
+ * Returns: immediate child of @root_type and ancestor of @leaf_type
*/
GType
g_type_next_base (GType type,
@@ -3549,8 +3549,8 @@ type_node_conforms_to_U (TypeNode *node,
/**
* g_type_is_a:
- * @type: type to check anchestry for
- * @is_a_type: possible anchestor of @type or interface that @type
+ * @type: type to check ancestry for
+ * @is_a_type: possible ancestor of @type or interface that @type
* could conform to
*
* If @is_a_type is a derivable type, check whether @type is a