felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1684634 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java
Date Wed, 10 Jun 2015 10:30:10 GMT
Author: davidb
Date: Wed Jun 10 10:30:09 2015
New Revision: 1684634

URL: http://svn.apache.org/r1684634
Log:
Further fix for potential race condition in Service Registry.

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java?rev=1684634&r1=1684633&r2=1684634&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java Wed
Jun 10 10:30:09 2015
@@ -419,9 +419,11 @@ public class ServiceRegistry
             {
                 if (count == 0)
                 {
+                    Object svc = usage.m_svcHolderRef.getAndSet(null).m_service;
+
                     // Remove reference from usages array.
                     ((ServiceRegistrationImpl.ServiceReferenceImpl) ref)
-                        .getRegistration().ungetService(bundle, usage.getService());
+                        .getRegistration().ungetService(bundle, svc);
                 }
             }
             finally



Mime
View raw message