[PATCH]: natThread.cc: Destroy join sync objects in finalizer

Boehm, Hans hans.boehm@hp.com
Tue Sep 14 04:25:00 GMT 2004


> -----Original Message-----
> From: Bryce McKinlay [mailto:mckinlay@redhat.com]
> Sent: Sunday, September 12, 2004 12:31 PM
> To: tromey@redhat.com
> Cc: Hans Boehm; gnustuff@thisiscool.com; GCJ Patches
> Subject: Re: [PATCH]: natThread.cc: Destroy join sync objects in
> finalizer
> 
> 
> Tom Tromey wrote:
> 
> >Hans> In this case, is it possible to invoke the cleanup code from
> >Hans> a java.lang.Thread finalizer?  Is java.lang.Thread 
> allowed to have
> >Hans> a finalizer?
> >
> >It can have a finalizer, but user code can override it.  So, there's
> >no guarantee it will be run.
> >
There is no guarantee.  But if it's not, I think that's a client bug.  The
general rule in Java seems to be that if you inherit from a class and define
a finalizer, then you should invoke the superclass finalizer when you finish.

It's probably better if we don't leak resources in that case, but I'm not sure
it qualifies as a libgcj bug if we do.

Hans



More information about the Java-patches mailing list