Re: [QUARTZ] Use Interlocked* functions in AddRef and Release (RESEND)
Paul Vriens <Paul.Vriens(a)xs4all.nl> writes:
TRACE("(%p)->()\n", iface); - if (!--This->refCount) + if (!InterlockedDecrement(&This->refCount)) { CoTaskMemFree(This->ppFilters); CoTaskMemFree(This);
You also need to store the result of the decrement and have the function return that value instead of This->refCount, otherwise it's still not thread-safe. -- Alexandre Julliard julliard(a)winehq.org
On Tue, 2005-01-04 at 21:48, Alexandre Julliard wrote:
Paul Vriens <Paul.Vriens(a)xs4all.nl> writes:
TRACE("(%p)->()\n", iface); - if (!--This->refCount) + if (!InterlockedDecrement(&This->refCount)) { CoTaskMemFree(This->ppFilters); CoTaskMemFree(This);
You also need to store the result of the decrement and have the function return that value instead of This->refCount, otherwise it's still not thread-safe.
OK. This will also mean fixing up 13 occurences of if (!InterlockedDecrement(&This-> for QUARTZ alone. I will fix them as well and resend ASAP. Cheers, Paul.
participants (2)
-
Alexandre Julliard -
Paul Vriens