diff options
author | Jens Reimann | 2015-11-06 20:29:19 +0000 |
---|---|---|
committer | Thomas Watson | 2015-11-06 20:31:33 +0000 |
commit | ed6bd715c652c830f9eac4c9c2cd8e39e5f974a1 (patch) | |
tree | a4abd68ace92b9e43693044ba81bdac3a29e6774 /bundles | |
parent | 2c5f314960b950b26d9997adac21713674542913 (diff) | |
download | rt.equinox.bundles-ed6bd715c652c830f9eac4c9c2cd8e39e5f974a1.tar.gz rt.equinox.bundles-ed6bd715c652c830f9eac4c9c2cd8e39e5f974a1.tar.xz rt.equinox.bundles-ed6bd715c652c830f9eac4c9c2cd8e39e5f974a1.zip |
Bug 459004 - Deadlock in configuration admin when using OSGi DS
Signed-off-by: Jens Reimann <jens.reimann@ibh-systems.com>
Diffstat (limited to 'bundles')
5 files changed, 23 insertions, 28 deletions
diff --git a/bundles/org.eclipse.equinox.cm/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.cm/META-INF/MANIFEST.MF index 01fc2619b..b5e14a195 100644 --- a/bundles/org.eclipse.equinox.cm/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.cm/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: %bundleName Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-SymbolicName: org.eclipse.equinox.cm -Bundle-Version: 1.1.100.qualifier +Bundle-Version: 1.1.200.qualifier Bundle-Activator: org.eclipse.equinox.internal.cm.Activator Import-Package: org.osgi.framework;version="1.7.0", org.osgi.service.cm;version="[1.5,1.6)", diff --git a/bundles/org.eclipse.equinox.cm/pom.xml b/bundles/org.eclipse.equinox.cm/pom.xml index 43645753a..4bc9a5b30 100644 --- a/bundles/org.eclipse.equinox.cm/pom.xml +++ b/bundles/org.eclipse.equinox.cm/pom.xml @@ -19,6 +19,6 @@ </parent> <groupId>org.eclipse.equinox</groupId> <artifactId>org.eclipse.equinox.cm</artifactId> - <version>1.1.100-SNAPSHOT</version> + <version>1.1.200-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ConfigurationStore.java b/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ConfigurationStore.java index ce86b6c81..68b0f715e 100644 --- a/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ConfigurationStore.java +++ b/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ConfigurationStore.java @@ -183,13 +183,16 @@ class ConfigurationStore { return configurations.get(pid); } - public synchronized ConfigurationImpl[] getFactoryConfigurations(String factoryPid) { + public ConfigurationImpl[] getFactoryConfigurations(String factoryPid) { List<ConfigurationImpl> resultList = new ArrayList<ConfigurationImpl>(); - for (Iterator<ConfigurationImpl> it = configurations.values().iterator(); it.hasNext();) { + synchronized (this) { + resultList.addAll(configurations.values()); + } + for (Iterator<ConfigurationImpl> it = resultList.iterator(); it.hasNext();) { ConfigurationImpl config = it.next(); String otherFactoryPid = config.getFactoryPid(); - if (otherFactoryPid != null && otherFactoryPid.equals(factoryPid)) - resultList.add(config); + if (otherFactoryPid == null || !otherFactoryPid.equals(factoryPid)) + it.remove(); } return resultList.toArray(new ConfigurationImpl[resultList.size()]); } diff --git a/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ManagedServiceFactoryTracker.java b/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ManagedServiceFactoryTracker.java index 5506b7ff5..af93f1acb 100644 --- a/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ManagedServiceFactoryTracker.java +++ b/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ManagedServiceFactoryTracker.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 Cognos Incorporated, IBM Corporation and others. + * Copyright (c) 2005, 2015 Cognos Incorporated, IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -151,9 +151,7 @@ class ManagedServiceFactoryTracker extends ServiceTracker<ManagedServiceFactory, if (service == null) return null; - synchronized (configurationStore) { - addReference(reference, service); - } + addReference(reference, service); return service; } @@ -180,16 +178,14 @@ class ManagedServiceFactoryTracker extends ServiceTracker<ManagedServiceFactory, } } } - synchronized (configurationStore) { - untrackManagedServiceFactory(reference); - addingService(reference); - } + + untrackManagedServiceFactory(reference); + addingService(reference); } public void removedService(ServiceReference<ManagedServiceFactory> reference, ManagedServiceFactory service) { - synchronized (configurationStore) { - untrackManagedServiceFactory(reference); - } + untrackManagedServiceFactory(reference); + context.ungetService(reference); } diff --git a/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ManagedServiceTracker.java b/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ManagedServiceTracker.java index 3690aa143..2aa969663 100644 --- a/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ManagedServiceTracker.java +++ b/bundles/org.eclipse.equinox.cm/src/org/eclipse/equinox/internal/cm/ManagedServiceTracker.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 Cognos Incorporated, IBM Corporation and others. + * Copyright (c) 2005, 2015 Cognos Incorporated, IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -160,9 +160,7 @@ class ManagedServiceTracker extends ServiceTracker<ManagedService, ManagedServic if (service == null) return null; - synchronized (configurationStore) { - addReference(reference, service); - } + addReference(reference, service); return service; } @@ -189,16 +187,14 @@ class ManagedServiceTracker extends ServiceTracker<ManagedService, ManagedServic } } } - synchronized (configurationStore) { - untrackManagedService(reference); - addingService(reference); - } + + untrackManagedService(reference); + addingService(reference); } public void removedService(ServiceReference<ManagedService> reference, ManagedService service) { - synchronized (configurationStore) { - untrackManagedService(reference); - } + untrackManagedService(reference); + context.ungetService(reference); } |