incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r720542 - /incubator/sling/trunk/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/SlingServletResolver.java
Date Tue, 25 Nov 2008 17:11:25 GMT
Author: bdelacretaz
Date: Tue Nov 25 09:11:25 2008
New Revision: 720542

URL: http://svn.apache.org/viewvc?rev=720542&view=rev
Log:
SLING-742 - SlingServletResolver.deactivate() synchronizes too much

Modified:
    incubator/sling/trunk/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/SlingServletResolver.java

Modified: incubator/sling/trunk/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/SlingServletResolver.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/SlingServletResolver.java?rev=720542&r1=720541&r2=720542&view=diff
==============================================================================
--- incubator/sling/trunk/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/SlingServletResolver.java
(original)
+++ incubator/sling/trunk/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/SlingServletResolver.java
Tue Nov 25 09:11:25 2008
@@ -529,15 +529,16 @@
 
     protected void deactivate(ComponentContext context) {
 
-        // destroy all active servlets
+        // Copy the list of servlets first, to minimize the need for synchronization
         Collection<ServiceReference> refs;
         synchronized (this) {
             refs = new ArrayList<ServiceReference>(servletsByReference.keySet());
-            // destroy all servlets
-            destroyAllServlets(refs);
-            this.context = null;
-            this.servletResourceProviderFactory = null;
         }
+        
+        // destroy all servlets
+        destroyAllServlets(refs);
+        this.context = null;
+        this.servletResourceProviderFactory = null;
     }
 
     protected synchronized void bindServlet(ServiceReference reference) {



Mime
View raw message