#define METHOD_CALL_TIMEOUT (300 * 1000)
struct GDBusClient {
- gint ref_count;
+ int ref_count;
DBusConnection *dbus_conn;
char *service_name;
char *unique_name;
};
struct GDBusProxy {
- gint ref_count;
+ int ref_count;
GDBusClient *client;
char *obj_path;
char *interface;
if (proxy == NULL)
return NULL;
- g_atomic_int_inc(&proxy->ref_count);
+ __sync_fetch_and_add(&proxy->ref_count, 1);
return proxy;
}
if (proxy == NULL)
return;
- if (g_atomic_int_dec_and_test(&proxy->ref_count) == FALSE)
+ if (__sync_sub_and_fetch(&proxy->ref_count, 1) > 0)
return;
g_hash_table_destroy(proxy->prop_list);
if (client == NULL)
return NULL;
- g_atomic_int_inc(&client->ref_count);
+ __sync_fetch_and_add(&client->ref_count, 1);
return client;
}
if (client == NULL)
return;
- if (g_atomic_int_dec_and_test(&client->ref_count) == FALSE)
+ if (__sync_sub_and_fetch(&client->ref_count, 1) > 0)
return;
if (client->pending_call != NULL) {