mirror of https://github.com/apache/lucene.git
SOLR-1538: Reordering of object allocations in ConcurrentLRUCache to eliminate (an extremeely small) potential for deadlock.
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@898119 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
10ce9576e3
commit
42e8d5c2c7
|
@ -196,6 +196,11 @@ Other Changes
|
|||
|
||||
* SOLR-1268: Add Lucene 2.9-dev r888785 FastVectorHighlighter contrib jar to lib. (koji)
|
||||
|
||||
* SOLR-1538: Reordering of object allocations in ConcurrentLRUCache to eliminate
|
||||
(an extremeely small) potential for deadlock.
|
||||
(gabriele renzi via hossman)
|
||||
|
||||
|
||||
Build
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -397,9 +397,9 @@ public class ConcurrentLRUCache<K,V> {
|
|||
* @return a LinkedHashMap containing 'n' or less than 'n' entries
|
||||
*/
|
||||
public Map<K, V> getOldestAccessedItems(int n) {
|
||||
markAndSweepLock.lock();
|
||||
Map<K, V> result = new LinkedHashMap<K, V>();
|
||||
TreeSet<CacheEntry> tree = new TreeSet<CacheEntry>();
|
||||
markAndSweepLock.lock();
|
||||
try {
|
||||
for (Map.Entry<Object, CacheEntry<K,V>> entry : map.entrySet()) {
|
||||
CacheEntry ce = entry.getValue();
|
||||
|
@ -423,10 +423,10 @@ public class ConcurrentLRUCache<K,V> {
|
|||
}
|
||||
|
||||
public Map<K,V> getLatestAccessedItems(int n) {
|
||||
// we need to grab the lock since we are changing lastAccessedCopy
|
||||
markAndSweepLock.lock();
|
||||
Map<K,V> result = new LinkedHashMap<K,V>();
|
||||
TreeSet<CacheEntry> tree = new TreeSet<CacheEntry>();
|
||||
// we need to grab the lock since we are changing lastAccessedCopy
|
||||
markAndSweepLock.lock();
|
||||
try {
|
||||
for (Map.Entry<Object, CacheEntry<K,V>> entry : map.entrySet()) {
|
||||
CacheEntry<K,V> ce = entry.getValue();
|
||||
|
|
Loading…
Reference in New Issue