This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PATCH: remove all traces of java.io.FileDescriptor from java.net
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Cc: Tom Tromey <tromey at redhat dot com>, java-patches at gcc dot gnu dot org
- Date: Wed, 27 Mar 2002 23:29:57 -0500 (EST)
- Subject: Re: PATCH: remove all traces of java.io.FileDescriptor from java.net
On Wed, 27 Mar 2002, Bryce McKinlay wrote:
> >Here's my updated patch. Hans convinced me that close/finalize ought to
> >synchronize access to fnum, I've included that below.
>
> Hmm, why is that? Also I noticed that it is actually synchronizing
> twice, both in finalize and close?
Finalize and close both access fnum, and will run in different threads. A
I understand the Java memory model, it is theoretically possible (however
unlikely) to have the same fd close twice if we don't synchronize.
We'd get the same effect by declaring fnum volatile, if volatile were
handled correctly.
Jeff