Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2015-07-30 21:13:09 +0000
committerThomas Watson2015-07-30 21:13:09 +0000
commita01aa517aa6aa58815d8db1b948db89611ca9dce (patch)
tree2de6d2e80c966b3d9b71e125bcd507628bed5960 /bundles
parent0e4556215f426832bb66ab86e2eca9b448bc61e5 (diff)
downloadrt.equinox.framework-a01aa517aa6aa58815d8db1b948db89611ca9dce.tar.gz
rt.equinox.framework-a01aa517aa6aa58815d8db1b948db89611ca9dce.tar.xz
rt.equinox.framework-a01aa517aa6aa58815d8db1b948db89611ca9dce.zip
Bug 455721 - Calling Framework.stop twice will potentially cause subsequent framework.start to hangI20150805-2000I20150805-0800I20150804-2000I20150804-0800I20150803-2000I20150803-0800I20150802-2000
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainer.java21
1 files changed, 15 insertions, 6 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainer.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainer.java
index 6a4b19d21..5f01e167d 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainer.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainer.java
@@ -157,17 +157,26 @@ public class EquinoxContainer implements ThreadFactory, Runnable {
}
void close() {
+ EventManager currentEventManager;
+ StorageSaver currentSaver;
+ Storage currentStorage;
+ ScheduledExecutorService currentExecutor;
synchronized (this.monitor) {
- eventManager.close();
+ currentEventManager = eventManager;
eventManager = null;
eventPublisher = null;
serviceRegistry = null;
- storageSaver.close();
- storage.close();
- // Must be done last since it will result in termination of the
- // framework active thread.
- executor.shutdown();
+ currentSaver = storageSaver;
+ currentStorage = storage;
+ currentExecutor = executor;
}
+ // do this outside of the lock to avoid deadlock
+ currentEventManager.close();
+ currentSaver.close();
+ currentStorage.close();
+ // Must be done last since it will result in termination of the
+ // framework active thread.
+ currentExecutor.shutdown();
}
private void initializeContextFinder() {

Back to the top