On 12/15/12 1:45 PM, Gilles Sadowski wrote:
> On Sat, Dec 15, 2012 at 07:24:05PM -0000, pste...@apache.org wrote:
>> Author: psteitz
>> Date: Sat Dec 15 19:24:04 2012
>> New Revision: 1422321
>>
>> URL: http://svn.apache.org/viewvc?rev=1422321&view=rev
>> Log:
>> Added sync to compute method.
>>
>> Modified:
>>     
>> commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java
>>
>> Modified: 
>> commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java
>> URL: 
>> http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java?rev=1422321&r1=1422320&r2=1422321&view=diff
>> ==============================================================================
>> --- 
>> commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java
>>  (original)
>> +++ 
>> commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java
>>  Sat Dec 15 19:24:04 2012
>> @@ -930,7 +930,7 @@ public class ResizableDoubleArray implem
>>       * @return the result.
>>       * @since 3.1
>>       */
>> -    public double compute(MathArrays.Function f) {
>> +    public synchronized double compute(MathArrays.Function f) {
>>          return f.evaluate(internalArray, startIndex, numElements);
>>      }
> Didn't we conclude that all "synchronized" keywords should be dropped?

If that is the case, we should remove them uniformly from this
class.  As it is now, the class is thread-safe.  Above was the only
method accessing member data that was not synchronized.
I think we concluded that we could not remove the sync protection
that was there in a dot release.  The above method is new and breaks
threadsafety unless protected.

Phil
>
>
> Gilles
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to