Huw Davies (@huw) commented about dlls/combase/marshal.c:
- do
- {
if (refs == 0)
{
/* This proxy manager is about to be destroyed */
return 0;
}
old_refs = refs;
new_refs = refs + 1;
- } while ((refs = InterlockedCompareExchange(&This->refs, new_refs, old_refs)) != old_refs);
- return new_refs;
+}
This isn't particularly pretty.
Have we thought about using the manager's cs to guard `refs` (and then remove the manager from the apt's list while in that cs? We'd need to be careful to not deadlock with the apt's cs of course.