tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r427821 - /tomcat/tc6.0.x/trunk/java/org/apache/naming/resources/ResourceCache.java
Date Wed, 02 Aug 2006 00:39:28 GMT
Author: remm
Date: Tue Aug  1 17:39:28 2006
New Revision: 427821

URL: http://svn.apache.org/viewvc?rev=427821&view=rev
Log:
- Use a single reference to the cache during lookup (the cache array could be concurrently
replaced).

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/naming/resources/ResourceCache.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/naming/resources/ResourceCache.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/naming/resources/ResourceCache.java?rev=427821&r1=427820&r2=427821&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/naming/resources/ResourceCache.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/naming/resources/ResourceCache.java Tue Aug  1 17:39:28
2006
@@ -289,10 +289,11 @@
     public CacheEntry lookup(String name) {
 
         CacheEntry cacheEntry = null;
+        CacheEntry[] currentCache = cache;
         accessCount++;
-        int pos = find(cache, name);
-        if ((pos != -1) && (name.equals(cache[pos].name))) {
-            cacheEntry = cache[pos];
+        int pos = find(currentCache, name);
+        if ((pos != -1) && (name.equals(currentCache[pos].name))) {
+            cacheEntry = currentCache[pos];
         }
         if (cacheEntry == null) {
             try {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message