diff options
author | Thomas Watson | 2015-11-06 20:37:01 +0000 |
---|---|---|
committer | Thomas Watson | 2015-11-06 20:37:01 +0000 |
commit | 9e00a26146072855a4ba1abf7bb53dea3d2cacdb (patch) | |
tree | 088a7b9f86e12199f7dc54e7c7cd877c99fe0585 | |
parent | ed6bd715c652c830f9eac4c9c2cd8e39e5f974a1 (diff) | |
download | rt.equinox.bundles-9e00a26146072855a4ba1abf7bb53dea3d2cacdb.tar.gz rt.equinox.bundles-9e00a26146072855a4ba1abf7bb53dea3d2cacdb.tar.xz rt.equinox.bundles-9e00a26146072855a4ba1abf7bb53dea3d2cacdb.zip |
Revert "Bug 459004 - Deadlock in configuration admin when using OSGi DS"
This reverts commit ed6bd715c652c830f9eac4c9c2cd8e39e5f974a1.
5 files changed, 28 insertions, 23 deletions
diff --git a/bundles/org.eclipse.equinox.cm/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.cm/META-INF/MANIFEST.MF index b5e14a195..01fc2619b 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.200.qualifier +Bundle-Version: 1.1.100.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 4bc9a5b30..43645753a 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.200-SNAPSHOT</version> + <version>1.1.100-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 68b0f715e..ce86b6c81 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,16 +183,13 @@ class ConfigurationStore { return configurations.get(pid); } - public ConfigurationImpl[] getFactoryConfigurations(String factoryPid) { + public synchronized ConfigurationImpl[] getFactoryConfigurations(String factoryPid) { List<ConfigurationImpl> resultList = new ArrayList<ConfigurationImpl>(); - synchronized (this) { - resultList.addAll(configurations.values()); - } - for (Iterator<ConfigurationImpl> it = resultList.iterator(); it.hasNext();) { + for (Iterator<ConfigurationImpl> it = configurations.values().iterator(); it.hasNext();) { ConfigurationImpl config = it.next(); String otherFactoryPid = config.getFactoryPid(); - if (otherFactoryPid == null || !otherFactoryPid.equals(factoryPid)) - it.remove(); + if (otherFactoryPid != null && otherFactoryPid.equals(factoryPid)) + resultList.add(config); } 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 af93f1acb..5506b7ff5 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, 2015 Cognos Incorporated, IBM Corporation and others. + * Copyright (c) 2005, 2013 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,7 +151,9 @@ class ManagedServiceFactoryTracker extends ServiceTracker<ManagedServiceFactory, if (service == null) return null; - addReference(reference, service); + synchronized (configurationStore) { + addReference(reference, service); + } return service; } @@ -178,14 +180,16 @@ class ManagedServiceFactoryTracker extends ServiceTracker<ManagedServiceFactory, } } } - - untrackManagedServiceFactory(reference); - addingService(reference); + synchronized (configurationStore) { + untrackManagedServiceFactory(reference); + addingService(reference); + } } public void removedService(ServiceReference<ManagedServiceFactory> reference, ManagedServiceFactory service) { - untrackManagedServiceFactory(reference); - + synchronized (configurationStore) { + 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 2aa969663..3690aa143 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, 2015 Cognos Incorporated, IBM Corporation and others. + * Copyright (c) 2005, 2013 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,7 +160,9 @@ class ManagedServiceTracker extends ServiceTracker<ManagedService, ManagedServic if (service == null) return null; - addReference(reference, service); + synchronized (configurationStore) { + addReference(reference, service); + } return service; } @@ -187,14 +189,16 @@ class ManagedServiceTracker extends ServiceTracker<ManagedService, ManagedServic } } } - - untrackManagedService(reference); - addingService(reference); + synchronized (configurationStore) { + untrackManagedService(reference); + addingService(reference); + } } public void removedService(ServiceReference<ManagedService> reference, ManagedService service) { - untrackManagedService(reference); - + synchronized (configurationStore) { + untrackManagedService(reference); + } context.ungetService(reference); } |