This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
RE: [PATCH]: natThread.cc: Destroy join sync objects in finalizer
- From: "Boehm, Hans" <hans dot boehm at hp dot com>
- To: "'Bryce McKinlay'" <mckinlay at redhat dot com>, tromey at redhat dot com
- Cc: "Boehm, Hans" <hans dot boehm at hp dot com>, gnustuff at thisiscool dot com,GCJ Patches <java-patches at gcc dot gnu dot org>
- Date: Sun, 12 Sep 2004 16:47:56 -0700
- Subject: RE: [PATCH]: natThread.cc: Destroy join sync objects in finalizer
> -----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