summaryrefslogtreecommitdiff
path: root/gdhcp/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdhcp/server.c')
-rw-r--r--gdhcp/server.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdhcp/server.c b/gdhcp/server.c
index 54c068b7..4f0b5b76 100644
--- a/gdhcp/server.c
+++ b/gdhcp/server.c
@@ -49,7 +49,7 @@
#define OFFER_TIME (5*60)
struct _GDHCPServer {
- gint ref_count;
+ int ref_count;
GDHCPType type;
gboolean started;
int ifindex;
@@ -821,7 +821,7 @@ GDHCPServer *g_dhcp_server_ref(GDHCPServer *dhcp_server)
if (dhcp_server == NULL)
return NULL;
- g_atomic_int_inc(&dhcp_server->ref_count);
+ __sync_fetch_and_add(&dhcp_server->ref_count, 1);
return dhcp_server;
}
@@ -846,7 +846,7 @@ void g_dhcp_server_unref(GDHCPServer *dhcp_server)
if (dhcp_server == NULL)
return;
- if (g_atomic_int_dec_and_test(&dhcp_server->ref_count) == FALSE)
+ if (__sync_fetch_and_sub(&dhcp_server->ref_count, 1) != 1)
return;
g_dhcp_server_stop(dhcp_server);