On Tuesday 21 April 2009 08:55:53 j16sdiz at freenetproject.org wrote:
> Author: j16sdiz
> Date: 2009-04-21 07:55:52 +0000 (Tue, 21 Apr 2009)
> New Revision: 27137
> 
> Modified:
>    trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
> Log:
> Fix inputStream count

What's the difference? Apart from your version breaks on an OOM and the 
previous version didn't?
> 
> Modified: trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java
> ===================================================================
> --- trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java        
2009-04-21 07:55:31 UTC (rev 27136)
> +++ trunk/freenet/src/freenet/support/io/PersistentBlobTempBucket.java        
2009-04-21 07:55:52 UTC (rev 27137)
> @@ -75,17 +75,15 @@
>       public InputStream getInputStream() throws IOException {
>               if(freed) throw new IOException("Already freed");
>               final FileChannel channel = factory.channel;
> +             
> +             synchronized(PersistentBlobTempBucket.this) {
> +                     inputStreams++;
> +             }
> +             
>               return new InputStream() {
> -
>                       private int offset;
>                       private boolean closed;
>                       
> -                     {
> -                             synchronized(PersistentBlobTempBucket.this) {
> -                                     inputStreams++;
> -                             }
> -                     }
> -                     
>                       @Override
>                       public int read() throws IOException {
>                               if (closed) throw new IOException("closed");
> @@ -130,6 +128,7 @@
>                       
>                       @Override
>                       public void close() {
> +                             if (closed) return;
>                               closed = true;
>                               
>                               synchronized(PersistentBlobTempBucket.this) {
> 
> _______________________________________________
> cvs mailing list
> cvs at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
> 
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090429/3cbbbc64/attachment.pgp>

Reply via email to