remm        2005/09/12 03:57:46

  Modified:    catalina/src/share/org/apache/naming/resources
                        ProxyDirContext.java
  Log:
  - Minor tweak: call a load to avoid possible useless allocate call when
    concurrently trying to add the same entry.
  
  Revision  Changes    Path
  1.19      +2 -2      
jakarta-tomcat-catalina/catalina/src/share/org/apache/naming/resources/ProxyDirContext.java
  
  Index: ProxyDirContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/naming/resources/ProxyDirContext.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- ProxyDirContext.java      20 Jul 2005 21:25:18 -0000      1.18
  +++ ProxyDirContext.java      12 Sep 2005 10:57:46 -0000      1.19
  @@ -1596,7 +1596,7 @@
           // Add new entry to cache
           synchronized (cache) {
               // Check cache size, and remove elements if too big
  -            if (cache.allocate(entry.size)) {
  +            if ((cache.lookup(name) == null) && cache.allocate(entry.size)) {
                   cache.load(entry);
               }
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to