|
From: | Richard Henderson |
Subject: | Re: [Qemu-devel] [PATCH v7 1/7] qom: apply atomic on object's refcount |
Date: | Wed, 28 Nov 2012 09:16:52 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
On 11/24/2012 06:02 PM, Liu Ping Fan wrote: > - obj->ref--; > > /* parent always holds a reference to its children */ > - if (obj->ref == 0) { > + if (__sync_fetch_and_sub(&obj->ref, 1) == 1) { if (__sync_sub_and_fetch(&obj->ref, 1) == 0) r~
[Prev in Thread] | Current Thread | [Next in Thread] |