GIOCondition condition;
};
-static volatile gint global_init_done = 0;
+static volatile int global_init_done = 0;
static inline void g_io_gnutls_global_init(void)
{
- if (g_atomic_int_compare_and_exchange(&global_init_done, 0, 1) == TRUE)
+ if (__sync_bool_compare_and_swap(&global_init_done, 0, 1) == TRUE)
gnutls_global_init();
}
};
struct _GResolv {
- gint ref_count;
+ int ref_count;
int result_family;
if (resolv == NULL)
return NULL;
- g_atomic_int_inc(&resolv->ref_count);
+ __sync_fetch_and_add(&resolv->ref_count, 1);
return resolv;
}
if (resolv == NULL)
return;
- if (g_atomic_int_dec_and_test(&resolv->ref_count) == FALSE)
+ if (__sync_fetch_and_sub(&resolv->ref_count, 1) != 1)
return;
while ((query = g_queue_pop_head(resolv->query_queue)))
};
struct _GWeb {
- gint ref_count;
+ int ref_count;
guint next_query_id;
if (web == NULL)
return NULL;
- g_atomic_int_inc(&web->ref_count);
+ __sync_fetch_and_add(&web->ref_count, 1);
return web;
}
if (web == NULL)
return;
- if (g_atomic_int_dec_and_test(&web->ref_count) == FALSE)
+ if (__sync_fetch_and_sub(&web->ref_count, 1) != 1)
return;
flush_sessions(web);
if (parser == NULL)
return NULL;
- g_atomic_int_inc(&parser->ref_count);
+ __sync_fetch_and_add(&parser->ref_count, 1);
return parser;
}
if (parser == NULL)
return;
- if (g_atomic_int_dec_and_test(&parser->ref_count) == FALSE)
+ if (__sync_fetch_and_sub(&parser->ref_count, 1) != 1)
return;
g_string_free(parser->content, TRUE);