[freenet-cvs] r18976 - trunk/freenet/src/freenet/client/async

Florent Daignière nextgens at freenetproject.org
Sat Apr 5 02:42:19 UTC 2008


* Matthew Toseland <toad at amphibian.dyndns.org> [2008-04-04 19:36:34]:

> On Friday 04 April 2008 07:12, nextgens at freenetproject.org wrote:
> > Author: nextgens
> > Date: 2008-04-04 06:12:05 +0000 (Fri, 04 Apr 2008)
> > New Revision: 18976
> > 
> > Modified:
> >    trunk/freenet/src/freenet/client/async/SplitFileFetcherSegment.java
> >    trunk/freenet/src/freenet/client/async/SplitFileInserter.java
> > Log:
> > Some sync fixes
> > 
> > Modified: 
> trunk/freenet/src/freenet/client/async/SplitFileFetcherSegment.java
> > ===================================================================
> > --- trunk/freenet/src/freenet/client/async/SplitFileFetcherSegment.java	
> 2008-04-04 06:05:54 UTC (rev 18975)
> > +++ trunk/freenet/src/freenet/client/async/SplitFileFetcherSegment.java	
> 2008-04-04 06:12:05 UTC (rev 18976)
> > @@ -52,7 +52,7 @@
> >  	final FetchContext fetchContext;
> >  	final long maxBlockLength;
> >  	/** Has the segment finished processing? Irreversible. */
> > -	private boolean finished;
> > +	private volatile boolean finished;
> >  	private boolean startedDecode;
> >  	/** Bucket to store the data retrieved, after it has been decoded */
> >  	private Bucket decodedData;
> > @@ -244,8 +244,10 @@
> >  				parentFetcher.segmentFinished(SplitFileFetcherSegment.this);
> >  		} catch (IOException e) {
> >  			Logger.normal(this, "Caught bucket error?: "+e, e);
> > -			finished = true;
> > -			failureException = new FetchException(FetchException.BUCKET_ERROR);
> > +			synchronized(this) {
> > +				finished = true;
> > +				failureException = new FetchException(FetchException.BUCKET_ERROR);
> > +			}
> >  			parentFetcher.segmentFinished(SplitFileFetcherSegment.this);
> >  			return;
> >  		}
> > 
> > Modified: trunk/freenet/src/freenet/client/async/SplitFileInserter.java
> > ===================================================================
> > --- trunk/freenet/src/freenet/client/async/SplitFileInserter.java	2008-04-04 
> 06:05:54 UTC (rev 18975)
> > +++ trunk/freenet/src/freenet/client/async/SplitFileInserter.java	2008-04-04 
> 06:12:05 UTC (rev 18976)
> > @@ -22,7 +22,7 @@
> >  
> >  public class SplitFileInserter implements ClientPutState {
> >  
> > -	private static boolean logMINOR;
> > +	private boolean logMINOR;
> 
> IMHO this should be static, making it per instance is a waste of memory.

Fixed in r18999 and r19000 (it's now static and volatile)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://emu.freenetproject.org/pipermail/cvs/attachments/20080405/0030d87c/attachment.pgp 


More information about the cvs mailing list