summaryrefslogtreecommitdiff
path: root/json-glib/json-value.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-value.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-value.c')
-rw-r--r--json-glib/json-value.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/json-glib/json-value.c b/json-glib/json-value.c
index 43ea4dd..b6d47e1 100644
--- a/json-glib/json-value.c
+++ b/json-glib/json-value.c
@@ -109,7 +109,7 @@ json_value_ref (JsonValue *value)
{
g_return_val_if_fail (value != NULL, NULL);
- g_atomic_int_add (&value->ref_count, 1);
+ value->ref_count++;
return value;
}
@@ -119,7 +119,7 @@ json_value_unref (JsonValue *value)
{
g_return_if_fail (value != NULL);
- if (g_atomic_int_dec_and_test (&value->ref_count))
+ if (--value->ref_count == 0)
json_value_free (value);
}