Re: JavaMemoryModel: Finalization idioms

From: Bob Lee (crazyboblee@gmail.com)
Date: Sat Apr 30 2005 - 23:36:26 EDT


Ahhhh... I'm an idiot.

Yuck. Any plans to add a finalizer annotation that would do this automatically?

Bob

On 4/30/05, David Holmes <dholmes@dltech.com.au> wrote:
> Bob Lee writes:
> > My point is that the empty synchronization blocks won't prevent the
> > finalizer from running before the other methods have completed, nor
> > will the volatile field accesses in #2. Am I missing something?
>
> You are missing something. The empty sync block forces the object to be
> reachable and so the finalizer can not run prior to the sync block
> completing execution.
>
> Cheers,
> David Holmes
>
>

-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:01:09 EDT