felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1543745 - /felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
Date Wed, 20 Nov 2013 09:54:46 GMT
Author: gnodet
Date: Wed Nov 20 09:54:45 2013
New Revision: 1543745

URL: http://svn.apache.org/r1543745
Log:
[FELIX-4313] Bad synchronization in scr where a lock is held while ungetting a service

Modified:
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java?rev=1543745&r1=1543744&r2=1543745&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
(original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
Wed Nov 20 09:54:45 2013
@@ -983,15 +983,17 @@ public class DependencyManager<S, T> imp
 
         public void close()
         {
+            RefPair<T> ref;
             synchronized ( getTracker().tracked() )
             {
-                if ( refPair != null )
-                {
-                    ungetService( refPair );
-                }
+                ref = refPair;
                 refPair = null;
-                getTracker().deactivate();
             }
+            if ( ref != null )
+            {
+                ungetService( ref );
+            }
+            getTracker().deactivate();
         }
 
         public Collection<RefPair<T>> getRefs( AtomicInteger trackingCount )



Mime
View raw message