[freenet-dev] [freenet-cvs] r18975 - trunk/freenet/src/freenet/client/async

Matthew Toseland toad at amphibian.dyndns.org
Fri Apr 4 18:22:27 UTC 2008


On Friday 04 April 2008 07:05, nextgens at freenetproject.org wrote:
> Author: nextgens
> Date: 2008-04-04 06:05:54 +0000 (Fri, 04 Apr 2008)
> New Revision: 18975
> 
> Modified:
>    trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java
> Log:
> Simplify a few things synchronization-wise declaring a few variables 
volatile 

I thought there were issues with volatile? Like it's not deterministic, and 
you really should use locking in all nontrivial cases?
> 
> Modified: 
trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java
> ===================================================================
> --- trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java	
2008-04-04 06:00:40 UTC (rev 18974)
> +++ trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java	
2008-04-04 06:05:54 UTC (rev 18975)
> @@ -46,14 +46,16 @@
>  
>  	final int segNo;
>  
> -	private boolean encoded;
> +	private volatile boolean encoded;
> +	
> +	private volatile boolean started;
> +	
> +	private volatile boolean finished;
> +	
> +	private volatile boolean hasURIs;
>  
> -	private boolean finished;
> -
>  	private final boolean getCHKOnly;
>  
> -	private boolean hasURIs;
> -
>  	private InsertException toThrow;
>  
>  	private final FailureCodeTracker errors;
> @@ -62,8 +64,6 @@
>  
>  	private int blocksCompleted;
>  
> -	private boolean started;
> -
>  	public SplitFileInserterSegment(SplitFileInserter parent,
>  			FECCodec splitfileAlgo, Bucket[] origDataBlocks,
>  			InsertContext blockInsertContext, boolean getCHKOnly, int segNo) {
> 
> _______________________________________________
> 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: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080404/bffdeeff/attachment.pgp 


More information about the Devl mailing list