felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsav...@apache.org
Subject svn commit: r814724 - /felix/trunk/sigil/common/core/src/org/apache/felix/sigil/model/ModelElementSupport.java
Date Mon, 14 Sep 2009 16:16:34 GMT
Author: dsavage
Date: Mon Sep 14 16:16:34 2009
New Revision: 814724

URL: http://svn.apache.org/viewvc?rev=814724&view=rev
Log:
add synchronized locks to cache methods to avoid potential cpu thrashing (FELIX-1592)

Modified:
    felix/trunk/sigil/common/core/src/org/apache/felix/sigil/model/ModelElementSupport.java

Modified: felix/trunk/sigil/common/core/src/org/apache/felix/sigil/model/ModelElementSupport.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/common/core/src/org/apache/felix/sigil/model/ModelElementSupport.java?rev=814724&r1=814723&r2=814724&view=diff
==============================================================================
--- felix/trunk/sigil/common/core/src/org/apache/felix/sigil/model/ModelElementSupport.java
(original)
+++ felix/trunk/sigil/common/core/src/org/apache/felix/sigil/model/ModelElementSupport.java
Mon Sep 14 16:16:34 2009
@@ -311,7 +311,7 @@
     }
 
 
-    private static PropertyAdapter[] cachedProps( Class<? extends IModelElement> type
)
+    private static synchronized PropertyAdapter[] cachedProps( Class<? extends IModelElement>
type )
     {
         SoftReference<PropertyAdapter[]> ref = propertyCache.get( type );
 
@@ -391,7 +391,7 @@
     }
 
 
-    private static ChildAdapter[] loadAdapters( IModelElement target )
+    private static synchronized ChildAdapter[] loadAdapters( IModelElement target )
     {
         Class<? extends IModelElement> type = target.getClass();
         SoftReference<ChildAdapter[]> ref = adapterCache.get( type );



Mime
View raw message