From: Emiel Bruijntjes Date: Sat, 28 Nov 2015 13:19:43 +0000 (+0100) Subject: subtract first, then retrieve value X-Git-Tag: json-c-0.13-20171207~59^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F211%2Fhead;p=thirdparty%2Fjson-c.git subtract first, then retrieve value --- diff --git a/json_object.c b/json_object.c index eae0f8a8..b7ca93b3 100644 --- a/json_object.c +++ b/json_object.c @@ -176,7 +176,7 @@ int json_object_put(struct json_object *jso) if(!jso) return 0; #if defined __GNUC__ - if (__sync_fetch_and_sub(&jso->_ref_count, 1) > 0) return 0; + if (__sync_sub_and_fetch(&jso->_ref_count, 1) > 0) return 0; #else if (--jso->_ref_count > 0) return 0; #endif