mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 23:16:14 +01:00
gdbusintrospection: Use atomic operations to read ref_count
This commit is contained in:
parent
b5a41afb18
commit
b599a0f414
@ -105,7 +105,7 @@ typedef struct
|
|||||||
GDBusNodeInfo *
|
GDBusNodeInfo *
|
||||||
g_dbus_node_info_ref (GDBusNodeInfo *info)
|
g_dbus_node_info_ref (GDBusNodeInfo *info)
|
||||||
{
|
{
|
||||||
if (info->ref_count == -1)
|
if (g_atomic_int_get (&info->ref_count) == -1)
|
||||||
return info;
|
return info;
|
||||||
g_atomic_int_inc (&info->ref_count);
|
g_atomic_int_inc (&info->ref_count);
|
||||||
return info;
|
return info;
|
||||||
@ -125,7 +125,7 @@ g_dbus_node_info_ref (GDBusNodeInfo *info)
|
|||||||
GDBusInterfaceInfo *
|
GDBusInterfaceInfo *
|
||||||
g_dbus_interface_info_ref (GDBusInterfaceInfo *info)
|
g_dbus_interface_info_ref (GDBusInterfaceInfo *info)
|
||||||
{
|
{
|
||||||
if (info->ref_count == -1)
|
if (g_atomic_int_get (&info->ref_count) == -1)
|
||||||
return info;
|
return info;
|
||||||
g_atomic_int_inc (&info->ref_count);
|
g_atomic_int_inc (&info->ref_count);
|
||||||
return info;
|
return info;
|
||||||
@ -145,7 +145,7 @@ g_dbus_interface_info_ref (GDBusInterfaceInfo *info)
|
|||||||
GDBusMethodInfo *
|
GDBusMethodInfo *
|
||||||
g_dbus_method_info_ref (GDBusMethodInfo *info)
|
g_dbus_method_info_ref (GDBusMethodInfo *info)
|
||||||
{
|
{
|
||||||
if (info->ref_count == -1)
|
if (g_atomic_int_get (&info->ref_count) == -1)
|
||||||
return info;
|
return info;
|
||||||
g_atomic_int_inc (&info->ref_count);
|
g_atomic_int_inc (&info->ref_count);
|
||||||
return info;
|
return info;
|
||||||
@ -165,7 +165,7 @@ g_dbus_method_info_ref (GDBusMethodInfo *info)
|
|||||||
GDBusSignalInfo *
|
GDBusSignalInfo *
|
||||||
g_dbus_signal_info_ref (GDBusSignalInfo *info)
|
g_dbus_signal_info_ref (GDBusSignalInfo *info)
|
||||||
{
|
{
|
||||||
if (info->ref_count == -1)
|
if (g_atomic_int_get (&info->ref_count) == -1)
|
||||||
return info;
|
return info;
|
||||||
g_atomic_int_inc (&info->ref_count);
|
g_atomic_int_inc (&info->ref_count);
|
||||||
return info;
|
return info;
|
||||||
@ -185,7 +185,7 @@ g_dbus_signal_info_ref (GDBusSignalInfo *info)
|
|||||||
GDBusPropertyInfo *
|
GDBusPropertyInfo *
|
||||||
g_dbus_property_info_ref (GDBusPropertyInfo *info)
|
g_dbus_property_info_ref (GDBusPropertyInfo *info)
|
||||||
{
|
{
|
||||||
if (info->ref_count == -1)
|
if (g_atomic_int_get (&info->ref_count) == -1)
|
||||||
return info;
|
return info;
|
||||||
g_atomic_int_inc (&info->ref_count);
|
g_atomic_int_inc (&info->ref_count);
|
||||||
return info;
|
return info;
|
||||||
@ -205,7 +205,7 @@ g_dbus_property_info_ref (GDBusPropertyInfo *info)
|
|||||||
GDBusArgInfo *
|
GDBusArgInfo *
|
||||||
g_dbus_arg_info_ref (GDBusArgInfo *info)
|
g_dbus_arg_info_ref (GDBusArgInfo *info)
|
||||||
{
|
{
|
||||||
if (info->ref_count == -1)
|
if (g_atomic_int_get (&info->ref_count) == -1)
|
||||||
return info;
|
return info;
|
||||||
g_atomic_int_inc (&info->ref_count);
|
g_atomic_int_inc (&info->ref_count);
|
||||||
return info;
|
return info;
|
||||||
@ -225,7 +225,7 @@ g_dbus_arg_info_ref (GDBusArgInfo *info)
|
|||||||
GDBusAnnotationInfo *
|
GDBusAnnotationInfo *
|
||||||
g_dbus_annotation_info_ref (GDBusAnnotationInfo *info)
|
g_dbus_annotation_info_ref (GDBusAnnotationInfo *info)
|
||||||
{
|
{
|
||||||
if (info->ref_count == -1)
|
if (g_atomic_int_get (&info->ref_count) == -1)
|
||||||
return info;
|
return info;
|
||||||
g_atomic_int_inc (&info->ref_count);
|
g_atomic_int_inc (&info->ref_count);
|
||||||
return info;
|
return info;
|
||||||
@ -258,7 +258,7 @@ free_null_terminated_array (gpointer array, GDestroyNotify unref_func)
|
|||||||
void
|
void
|
||||||
g_dbus_annotation_info_unref (GDBusAnnotationInfo *info)
|
g_dbus_annotation_info_unref (GDBusAnnotationInfo *info)
|
||||||
{
|
{
|
||||||
if (info->ref_count == -1)
|
if (g_atomic_int_get (&info->ref_count) == -1)
|
||||||
return;
|
return;
|
||||||
if (g_atomic_int_dec_and_test (&info->ref_count))
|
if (g_atomic_int_dec_and_test (&info->ref_count))
|
||||||
{
|
{
|
||||||
@ -282,7 +282,7 @@ g_dbus_annotation_info_unref (GDBusAnnotationInfo *info)
|
|||||||
void
|
void
|
||||||
g_dbus_arg_info_unref (GDBusArgInfo *info)
|
g_dbus_arg_info_unref (GDBusArgInfo *info)
|
||||||
{
|
{
|
||||||
if (info->ref_count == -1)
|
if (g_atomic_int_get (&info->ref_count) == -1)
|
||||||
return;
|
return;
|
||||||
if (g_atomic_int_dec_and_test (&info->ref_count))
|
if (g_atomic_int_dec_and_test (&info->ref_count))
|
||||||
{
|
{
|
||||||
@ -306,7 +306,7 @@ g_dbus_arg_info_unref (GDBusArgInfo *info)
|
|||||||
void
|
void
|
||||||
g_dbus_method_info_unref (GDBusMethodInfo *info)
|
g_dbus_method_info_unref (GDBusMethodInfo *info)
|
||||||
{
|
{
|
||||||
if (info->ref_count == -1)
|
if (g_atomic_int_get (&info->ref_count) == -1)
|
||||||
return;
|
return;
|
||||||
if (g_atomic_int_dec_and_test (&info->ref_count))
|
if (g_atomic_int_dec_and_test (&info->ref_count))
|
||||||
{
|
{
|
||||||
@ -331,7 +331,7 @@ g_dbus_method_info_unref (GDBusMethodInfo *info)
|
|||||||
void
|
void
|
||||||
g_dbus_signal_info_unref (GDBusSignalInfo *info)
|
g_dbus_signal_info_unref (GDBusSignalInfo *info)
|
||||||
{
|
{
|
||||||
if (info->ref_count == -1)
|
if (g_atomic_int_get (&info->ref_count) == -1)
|
||||||
return;
|
return;
|
||||||
if (g_atomic_int_dec_and_test (&info->ref_count))
|
if (g_atomic_int_dec_and_test (&info->ref_count))
|
||||||
{
|
{
|
||||||
@ -355,7 +355,7 @@ g_dbus_signal_info_unref (GDBusSignalInfo *info)
|
|||||||
void
|
void
|
||||||
g_dbus_property_info_unref (GDBusPropertyInfo *info)
|
g_dbus_property_info_unref (GDBusPropertyInfo *info)
|
||||||
{
|
{
|
||||||
if (info->ref_count == -1)
|
if (g_atomic_int_get (&info->ref_count) == -1)
|
||||||
return;
|
return;
|
||||||
if (g_atomic_int_dec_and_test (&info->ref_count))
|
if (g_atomic_int_dec_and_test (&info->ref_count))
|
||||||
{
|
{
|
||||||
@ -379,7 +379,7 @@ g_dbus_property_info_unref (GDBusPropertyInfo *info)
|
|||||||
void
|
void
|
||||||
g_dbus_interface_info_unref (GDBusInterfaceInfo *info)
|
g_dbus_interface_info_unref (GDBusInterfaceInfo *info)
|
||||||
{
|
{
|
||||||
if (info->ref_count == -1)
|
if (g_atomic_int_get (&info->ref_count) == -1)
|
||||||
return;
|
return;
|
||||||
if (g_atomic_int_dec_and_test (&info->ref_count))
|
if (g_atomic_int_dec_and_test (&info->ref_count))
|
||||||
{
|
{
|
||||||
@ -405,7 +405,7 @@ g_dbus_interface_info_unref (GDBusInterfaceInfo *info)
|
|||||||
void
|
void
|
||||||
g_dbus_node_info_unref (GDBusNodeInfo *info)
|
g_dbus_node_info_unref (GDBusNodeInfo *info)
|
||||||
{
|
{
|
||||||
if (info->ref_count == -1)
|
if (g_atomic_int_get (&info->ref_count) == -1)
|
||||||
return;
|
return;
|
||||||
if (g_atomic_int_dec_and_test (&info->ref_count))
|
if (g_atomic_int_dec_and_test (&info->ref_count))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user