JEP 132: More-prompt finalization (Re: Another take on Finalization)
Kim Barrett
kim.barrett at oracle.com
Mon Jun 8 23:41:21 UTC 2015
On Jun 8, 2015, at 1:45 PM, Rezaei, Mohammad A. <Mohammad.Rezaei at gs.com> wrote:
>
> If that's the case, the documentation needs to be more clear :-) It currently says:
>
> "Clears this reference object. Invoking this method will not cause this object to be enqueued."
>
> I interpret that as meaning the reference will not be put on the queue as a part of the clear() call.
>
> The bit of code that prevents this queuing is nowhere to be seen
It’s in the VM; see callers of (C++) discover_reference, which all skip that call if the referent is null.
For example:
http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/annotate/431b1333b1c1/src/share/vm/oops/instanceRefKlass.inline.hpp
circa line 47
More information about the core-libs-dev
mailing list