summaryrefslogtreecommitdiff
path: root/json-glib/json-array.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2015-11-07 18:01:54 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2016-01-28 10:18:56 +0100
commit28c7347150d24383114f06457c3a8d5f5d8eab00 (patch)
treed71778251d492f7df24bbb7485eb55b3491c5ace /json-glib/json-array.c
parentd8720da7ec351e5f15f6ce7baf96434ea42bb111 (diff)
downloadjson-glib-28c7347150d24383114f06457c3a8d5f5d8eab00.tar.gz
core: Remove atomic operations for reference counting
They are not needed — json-glib is not at all thread safe.
Diffstat (limited to 'json-glib/json-array.c')
-rw-r--r--json-glib/json-array.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/json-glib/json-array.c b/json-glib/json-array.c
index b8186e4..af67b4a 100644
--- a/json-glib/json-array.c
+++ b/json-glib/json-array.c
@@ -100,7 +100,7 @@ json_array_ref (JsonArray *array)
g_return_val_if_fail (array != NULL, NULL);
g_return_val_if_fail (array->ref_count > 0, NULL);
- g_atomic_int_add (&array->ref_count, 1);
+ array->ref_count++;
return array;
}
@@ -119,7 +119,7 @@ json_array_unref (JsonArray *array)
g_return_if_fail (array != NULL);
g_return_if_fail (array->ref_count > 0);
- if (g_atomic_int_dec_and_test (&array->ref_count))
+ if (--array->ref_count == 0)
{
guint i;