commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r1094856 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
Date Tue, 19 Apr 2011 14:57:23 GMT
On 19 April 2011 15:30, Stefan Bodewig <bodewig@apache.org> wrote:
> On 2011-04-19, sebb wrote:
>
>> On 19 April 2011 06:35,  <bodewig@apache.org> wrote:
>
>>>>        // this flag is only written here and read in finalize() which
>>>>        // can never be run in parallel.
>>>>        // no synchronization needed.
>
>> Are you sure?
>
> At least as long as finalize is not called by anybody else but the
> garbage collector.
>
> You can't call close without a reference to the object and as long as
> such a reference exists finalize will not be called.

OK, I was thinking that GC would be equivalent to a separate thread.
But thinking about it, I suppose the JMM must make special provision
for the GC to ensure that cached writes are flushed.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message