You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by da...@apache.org on 2015/09/18 13:54:02 UTC
svn commit: r1703814 -
/felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistry.java
Author: davidb
Date: Fri Sep 18 11:54:02 2015
New Revision: 1703814
URL: http://svn.apache.org/viewvc?rev=1703814&view=rev
Log:
FELIX-5043 Potential of waiting forever in ServiceRegistry.getService()
This commit should fix the issue. I'll contribute a test in a separate commit.
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=1703814&r1=1703813&r2=1703814&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 Fri Sep 18 11:54:02 2015
@@ -340,9 +340,12 @@ public class ServiceRegistry
if (usage.m_svcHolderRef.compareAndSet(null, h))
{
holder = h;
- svcObj = reg.getService(bundle);
- holder.m_service = svcObj;
- holder.m_latch.countDown();
+ try {
+ svcObj = reg.getService(bundle);
+ holder.m_service = svcObj;
+ } finally {
+ holder.m_latch.countDown();
+ }
}
else
{