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

revise SoftRefCache.get()

parent 5d9f4b4c
Branches
No related tags found
No related merge requests found
......@@ -81,11 +81,11 @@ public class SoftRefCache< K, V > implements Cache< K, V >
if ( value == null )
{
synchronized ( entry )
{
// check that we still have the live entry in the map
if ( entry == map.get( key ) )
{
if ( entry.wasLoaded() )
{
value = entry.getValue();
if ( value == null )
{
/*
* The entry was already loaded, but its value has been
......@@ -94,6 +94,7 @@ public class SoftRefCache< K, V > implements Cache< K, V >
map.remove( key, entry );
value = get( key, loader );
}
}
else
{
try
......@@ -112,7 +113,6 @@ public class SoftRefCache< K, V > implements Cache< K, V >
}
}
}
}
cleanUp( 50 );
}
return value;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment