You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by yo...@apache.org on 2008/07/31 20:59:52 UTC
svn commit: r681440 -
/lucene/solr/trunk/src/java/org/apache/solr/search/LRUCache.java
Author: yonik
Date: Thu Jul 31 11:59:52 2008
New Revision: 681440
URL: http://svn.apache.org/viewvc?rev=681440&view=rev
Log:
LRUCache impl synchronizes on the map, not the cache
Modified:
lucene/solr/trunk/src/java/org/apache/solr/search/LRUCache.java
Modified: lucene/solr/trunk/src/java/org/apache/solr/search/LRUCache.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/search/LRUCache.java?rev=681440&r1=681439&r2=681440&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/search/LRUCache.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/search/LRUCache.java Thu Jul 31 11:59:52 2008
@@ -113,12 +113,12 @@
}
}
- public synchronized Object put(Object key, Object value) {
- if (state == State.LIVE) {
- stats.inserts.incrementAndGet();
- }
-
+ public Object put(Object key, Object value) {
synchronized (map) {
+ if (state == State.LIVE) {
+ stats.inserts.incrementAndGet();
+ }
+
// increment local inserts regardless of state???
// it does make it more consistent with the current size...
inserts++;