Lightweight finalization for the JDK without any drawbacks was: Why is finalize wrong?
aph at redhat.com
Thu Aug 7 07:17:16 UTC 2014
On 06/08/14 11:17, Jaroslav Tulach wrote:
>> Yup. Did you know that an object can be finalized while there are still
>> > instance methods of that object executing? We've actually seen it
> Sure, but that cannot happen with activeQueue() as the referent is really gone
> before appropriate Reference.run() is executed.
I'm sure that it can happen, in just the same way. An object can be
"really gone" even when one of its instance methods is still executing.
I'm wondering whether it's really worth your time applying band-aids to
a broken mechanism.
More information about the core-libs-dev