summaryrefslogtreecommitdiff
path: root/gweb
diff options
context:
space:
mode:
Diffstat (limited to 'gweb')
-rw-r--r--gweb/giognutls.c4
-rw-r--r--gweb/gresolv.c6
-rw-r--r--gweb/gweb.c10
3 files changed, 10 insertions, 10 deletions
diff --git a/gweb/giognutls.c b/gweb/giognutls.c
index a9b734fa..d92ae959 100644
--- a/gweb/giognutls.c
+++ b/gweb/giognutls.c
@@ -54,11 +54,11 @@ struct _GIOGnuTLSWatch {
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();
}
diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index 326b5f94..6bfc20a4 100644
--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -97,7 +97,7 @@ struct resolv_nameserver {
};
struct _GResolv {
- gint ref_count;
+ int ref_count;
int result_family;
@@ -826,7 +826,7 @@ GResolv *g_resolv_ref(GResolv *resolv)
if (resolv == NULL)
return NULL;
- g_atomic_int_inc(&resolv->ref_count);
+ __sync_fetch_and_add(&resolv->ref_count, 1);
return resolv;
}
@@ -838,7 +838,7 @@ void g_resolv_unref(GResolv *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)))
diff --git a/gweb/gweb.c b/gweb/gweb.c
index b7cfe62e..5c3305ef 100644
--- a/gweb/gweb.c
+++ b/gweb/gweb.c
@@ -97,7 +97,7 @@ struct web_session {
};
struct _GWeb {
- gint ref_count;
+ int ref_count;
guint next_query_id;
@@ -228,7 +228,7 @@ GWeb *g_web_ref(GWeb *web)
if (web == NULL)
return NULL;
- g_atomic_int_inc(&web->ref_count);
+ __sync_fetch_and_add(&web->ref_count, 1);
return web;
}
@@ -238,7 +238,7 @@ void g_web_unref(GWeb *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);
@@ -1316,7 +1316,7 @@ GWebParser *g_web_parser_ref(GWebParser *parser)
if (parser == NULL)
return NULL;
- g_atomic_int_inc(&parser->ref_count);
+ __sync_fetch_and_add(&parser->ref_count, 1);
return parser;
}
@@ -1326,7 +1326,7 @@ void g_web_parser_unref(GWebParser *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);