code review request : 7105952: Improve finalisation for FileInputStream/FileOutputStream/RandomAccessFile

Seán Coffey sean.coffey at oracle.com
Tue Nov 1 15:09:56 UTC 2011


The fd count was only used if it was the finalizer thread. Any explicit 
close() call not from finalizer meant that the FD got closed.

         /*
          * If FileDescriptor is still in use by another stream, the 
finalizer
          * will not close it.
          */
         if ((useCount <= 0) || !isRunningFinalize()) {
             close0();
         }

regards,
Sean.

On 01/11/2011 14:57, Charles Lee wrote:
>>
> Does it change the original mechanism? IIRC, the original will remain 
> the other FileInputStream function well (can read from the under 
> stream), until the fd count become 0. 



More information about the core-libs-dev mailing list