Skip to content
Snippets Groups Projects
Commit 40423592 authored by Tobias Pietzsch's avatar Tobias Pietzsch
Browse files

only a part of VolatileGlobalCellCache.createGlobal() needs to be synchronized

parent a72b7403
No related branches found
No related tags found
No related merge requests found
......@@ -407,11 +407,13 @@ public class VolatileGlobalCellCache< A extends VolatileAccess > implements Cach
*
* @return a cell with the specified coordinates.
*/
public synchronized VolatileCell< A > createGlobal( final int[] cellDims, final long[] cellMin, final int timepoint, final int setup, final int level, final int index, final LoadingStrategy loadingStrategy )
public VolatileCell< A > createGlobal( final int[] cellDims, final long[] cellMin, final int timepoint, final int setup, final int level, final int index, final LoadingStrategy loadingStrategy )
{
final Key k = new Key( timepoint, setup, level, index );
Entry entry = null;
synchronized ( softReferenceCache )
{
final Reference< Entry > ref = softReferenceCache.get( k );
if ( ref != null )
entry = ref.get();
......@@ -422,6 +424,7 @@ public class VolatileGlobalCellCache< A extends VolatileAccess > implements Cach
entry = new Entry( k, cell );
softReferenceCache.put( k, new WeakReference< Entry >( entry ) );
}
}
switch ( loadingStrategy )
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment