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
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
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs