JDK-8027351: (ref) Base's class finalize method not invoked if a private finalize method exists in its subclass
Peter Levart
peter.levart at gmail.com
Tue Nov 5 13:14:06 UTC 2013
On 11/05/2013 12:33 PM, Chris Hegarty wrote:
> On 05/11/2013 10:59, Paul Sandoz wrote:
>> On Nov 5, 2013, at 8:26 AM, Peter Levart<peter.levart at gmail.com> wrote:
>>>
>>> P.S. I'm curious about the strange seemingly unneeded code fragments
>>> in FinalizerThread and both Runnables. For example:
>>>
>>> 169 forkSecondaryFinalizer(new Runnable() {
>>> 170*private volatile boolean running;*
>>> 171 public void run() {
>>> 172*if (running)*
>>> 173*return;*
>>> 174*running = true;*
>>>
>>> The FinalizerThread and each Runnable instance is only executed
>>> once. Why these checks then? Does anybody know?
>>>
>>
>> I was wondering that too. A Thread is an instance of Runnable. So a
>> finalize method could re-exec the current finalizer thread on another
>> another thread.
>
> Right. I added these a while back to ensure that this does not happen.
>
> -Chris.
That's really mean 8-)
Peter
>
>>
>> Paul.
More information about the core-libs-dev
mailing list