summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/polkit/polkitidentity.c10
-rw-r--r--src/polkit/polkitsubject.c10
-rw-r--r--src/polkitbackend/polkitbackendactionlookup.c10
3 files changed, 18 insertions, 12 deletions
diff --git a/src/polkit/polkitidentity.c b/src/polkit/polkitidentity.c
index dd15b2f..7813c2c 100644
--- a/src/polkit/polkitidentity.c
+++ b/src/polkit/polkitidentity.c
@@ -49,9 +49,9 @@ base_init (gpointer g_iface)
GType
polkit_identity_get_type (void)
{
- static GType iface_type = 0;
+ static volatile gsize g_define_type_id__volatile = 0;
- if (iface_type == 0)
+ if (g_once_init_enter (&g_define_type_id__volatile))
{
static const GTypeInfo info =
{
@@ -67,12 +67,14 @@ polkit_identity_get_type (void)
NULL /* value_table */
};
- iface_type = g_type_register_static (G_TYPE_INTERFACE, "PolkitIdentity", &info, 0);
+ GType iface_type =
+ g_type_register_static (G_TYPE_INTERFACE, "PolkitIdentity", &info, 0);
g_type_interface_add_prerequisite (iface_type, G_TYPE_OBJECT);
+ g_once_init_leave (&g_define_type_id__volatile, iface_type);
}
- return iface_type;
+ return g_define_type_id__volatile;
}
/**
diff --git a/src/polkit/polkitsubject.c b/src/polkit/polkitsubject.c
index d2c4c20..aed5795 100644
--- a/src/polkit/polkitsubject.c
+++ b/src/polkit/polkitsubject.c
@@ -50,9 +50,9 @@ base_init (gpointer g_iface)
GType
polkit_subject_get_type (void)
{
- static GType iface_type = 0;
+ static volatile gsize g_define_type_id__volatile = 0;
- if (iface_type == 0)
+ if (g_once_init_enter (&g_define_type_id__volatile))
{
static const GTypeInfo info =
{
@@ -68,12 +68,14 @@ polkit_subject_get_type (void)
NULL /* value_table */
};
- iface_type = g_type_register_static (G_TYPE_INTERFACE, "PolkitSubject", &info, 0);
+ GType iface_type =
+ g_type_register_static (G_TYPE_INTERFACE, "PolkitSubject", &info, 0);
g_type_interface_add_prerequisite (iface_type, G_TYPE_OBJECT);
+ g_once_init_leave (&g_define_type_id__volatile, iface_type);
}
- return iface_type;
+ return g_define_type_id__volatile;
}
/**
diff --git a/src/polkitbackend/polkitbackendactionlookup.c b/src/polkitbackend/polkitbackendactionlookup.c
index 5a1a228..20747e7 100644
--- a/src/polkitbackend/polkitbackendactionlookup.c
+++ b/src/polkitbackend/polkitbackendactionlookup.c
@@ -74,9 +74,9 @@ base_init (gpointer g_iface)
GType
polkit_backend_action_lookup_get_type (void)
{
- static GType iface_type = 0;
+ static volatile gsize g_define_type_id__volatile = 0;
- if (iface_type == 0)
+ if (g_once_init_enter (&g_define_type_id__volatile))
{
static const GTypeInfo info =
{
@@ -92,12 +92,14 @@ polkit_backend_action_lookup_get_type (void)
NULL /* value_table */
};
- iface_type = g_type_register_static (G_TYPE_INTERFACE, "PolkitBackendActionLookup", &info, 0);
+ GType iface_type =
+ g_type_register_static (G_TYPE_INTERFACE, "PolkitBackendActionLookup", &info, 0);
g_type_interface_add_prerequisite (iface_type, G_TYPE_OBJECT);
+ g_once_init_leave (&g_define_type_id__volatile, iface_type);
}
- return iface_type;
+ return g_define_type_id__volatile;
}
/**